1
From c3bd441280e855a84e86e0ec2bc5c1fdaab79821 Mon Sep 17 00:00:00 2001
2
From: Jari Aalto <jari.aalto@cante.net>
3
Date: Fri, 18 Nov 2011 15:33:54 +0200
4
Subject: [PATCH] Web/ratfor.c: miscellaneous
6
Content-Type: text/plain; charset="utf-8"
7
Content-Transfer-Encoding: 8bit
9
Signed-off-by: Jari Aalto <jari.aalto@cante.net>
11
Web/ratfor.c | 687 ++++++++++++++++++++++++++++++++++++++++++++--------------
12
1 files changed, 522 insertions(+), 165 deletions(-)
14
diff --git a/Web/ratfor.c b/Web/ratfor.c
15
index 444a144..f6d7ebb 100644
21
- created with UNIX on "Thursday, September 24, 1998 at 16:12." \
22
- COMMAND LINE: "Web/ftangle Web/ratfor -A -# --F -= 1.62/Web/ratfor.c"\
23
- RUN TIME: "Friday, September 25, 1998 at 8:02."\
24
- WEB FILE: "Web/ratfor.web"\
26
+ created with UNIX on "Friday, September 25, 1998 at 8:02." \
27
+ COMMAND LINE: "ftangle ./ratfor -uCONFIG -mCONFIG -mGCC -= ratfor.c"\
28
+ RUN TIME: "Tuesday, June 29, 1999 at 21:24."\
29
+ WEB FILE: "./ratfor.web"\
35
-#define stringg (eight_bits)02 \
36
+#define stringg (eight_bits)'\2' \
38
-#define constant (eight_bits)03
39
+#define constant (eight_bits)'\3'
40
#define begin_Xmeta or_or
41
#define end_Xmeta star_star
42
-#define cdir (eight_bits)06
43
-#define colon_colon (eight_bits)011 \
44
+#define cdir (eight_bits)'\6'
45
+#define colon_colon (eight_bits)'\11' \
47
-#define join (eight_bits)0177 \
48
+#define join (eight_bits)'\177' \
51
#define TOKEN1(a)((a)<ID0) \
56
-#define begin_comment0 (eight_bits)0376
57
-#define begin_comment1 (eight_bits)0375 \
58
+#define begin_comment0 (eight_bits)'\xFE'
59
+#define begin_comment1 (eight_bits)'\xFD' \
61
-#define module_number (eight_bits)0201
62
-#define identifier (eight_bits)0202
63
-#define id_keyword (eight_bits)0203 \
64
+#define module_number (eight_bits)'\201'
65
+#define identifier (eight_bits)'\202'
66
+#define id_keyword (eight_bits)'\203' \
68
-#define L_switch (eight_bits)0257
69
-#define begin_FORTRAN (eight_bits)0260
70
-#define begin_RATFOR (eight_bits)0261
71
-#define begin_C (eight_bits)0262
72
-#define begin_LITERAL (eight_bits)0263 \
73
+#define L_switch (eight_bits)'\257'
74
+#define begin_FORTRAN (eight_bits)'\260'
75
+#define begin_RATFOR (eight_bits)'\261'
76
+#define begin_C (eight_bits)'\262'
77
+#define begin_LITERAL (eight_bits)'\263' \
79
-#define verbatim (eight_bits)0264 \
80
+#define verbatim (eight_bits)'\264' \
83
-#define invisible_cmnt (eight_bits)0265
84
-#define compiler_directive (eight_bits)0266
85
-#define Compiler_Directive (eight_bits)0267 \
86
+#define invisible_cmnt (eight_bits)'\265'
87
+#define compiler_directive (eight_bits)'\266'
88
+#define Compiler_Directive (eight_bits)'\267' \
90
-#define keyword_name (eight_bits)0270 \
91
+#define keyword_name (eight_bits)'\270' \
93
-#define no_index (eight_bits)0300
94
-#define yes_index (eight_bits)0301 \
95
+#define no_index (eight_bits)'\300'
96
+#define yes_index (eight_bits)'\301' \
98
-#define ascii_constant (eight_bits)0302
99
-#define begin_vcmnt (eight_bits)0303
100
-#define big_line_break (eight_bits)0304 \
101
+#define ascii_constant (eight_bits)'\302'
102
+#define begin_vcmnt (eight_bits)'\303'
103
+#define big_line_break (eight_bits)'\304' \
105
-#define begin_bp (eight_bits)0305
106
-#define insert_bp (eight_bits)0306 \
107
+#define begin_bp (eight_bits)'\305'
108
+#define insert_bp (eight_bits)'\306' \
110
-#define begin_meta (eight_bits)017
111
-#define end_meta (eight_bits)027 \
112
+#define begin_meta (eight_bits)'\17'
113
+#define end_meta (eight_bits)'\27' \
115
-#define TeX_string (eight_bits)0307
116
-#define xref_roman (eight_bits)0310
117
-#define xref_typewriter (eight_bits)0311
118
-#define xref_wildcard (eight_bits)0312 \
119
+#define TeX_string (eight_bits)'\307'
120
+#define xref_roman (eight_bits)'\310'
121
+#define xref_typewriter (eight_bits)'\311'
122
+#define xref_wildcard (eight_bits)'\312' \
124
-#define control_text (eight_bits)0313 \
125
+#define control_text (eight_bits)'\313' \
127
-#define begin_nuweb (eight_bits)0314
128
-#define no_mac_expand (eight_bits)0315
129
-#define set_line_info (eight_bits)0316
130
-#define short_fcn (eight_bits)0317 \
131
+#define begin_nuweb (eight_bits)'\314'
132
+#define no_mac_expand (eight_bits)'\315'
133
+#define set_line_info (eight_bits)'\316'
134
+#define short_fcn (eight_bits)'\317' \
136
-#define formatt (eight_bits)0320 \
137
+#define formatt (eight_bits)'\320' \
139
-#define limbo_text (eight_bits)0323
140
-#define op_def (eight_bits)0324
141
-#define macro_def (eight_bits)0325 \
142
+#define limbo_text (eight_bits)'\323'
143
+#define op_def (eight_bits)'\324'
144
+#define macro_def (eight_bits)'\325' \
146
-#define ignore_defn (eight_bits)0327 \
147
+#define ignore_defn (eight_bits)'\327' \
149
-#define new_output_file (eight_bits)0331 \
150
+#define new_output_file (eight_bits)'\331' \
152
-#define definition (eight_bits)0332
153
-#define undefinition (eight_bits)0333
154
-#define WEB_definition (eight_bits)0334 \
155
+#define definition (eight_bits)'\332'
156
+#define undefinition (eight_bits)'\333'
157
+#define WEB_definition (eight_bits)'\334' \
159
-#define m_ifdef (eight_bits)0335
160
-#define m_ifndef (eight_bits)0336
161
-#define m_if (eight_bits)0337
162
-#define m_else (eight_bits)0340
163
-#define m_elif (eight_bits)0341
164
-#define m_endif (eight_bits)0342
165
-#define m_for (eight_bits)0343
166
-#define m_endfor (eight_bits)0344
167
-#define m_line (eight_bits)0345
168
-#define m_undef (eight_bits)0346 \
169
+#define m_ifdef (eight_bits)'\335'
170
+#define m_ifndef (eight_bits)'\336'
171
+#define m_if (eight_bits)'\337'
172
+#define m_else (eight_bits)'\340'
173
+#define m_elif (eight_bits)'\341'
174
+#define m_endif (eight_bits)'\342'
175
+#define m_for (eight_bits)'\343'
176
+#define m_endfor (eight_bits)'\344'
177
+#define m_line (eight_bits)'\345'
178
+#define m_undef (eight_bits)'\346' \
180
-#define end_of_buffer (eight_bits)0347 \
181
+#define end_of_buffer (eight_bits)'\347' \
183
-#define begin_code (eight_bits)0350
184
-#define module_name (eight_bits)0351 \
185
+#define begin_code (eight_bits)'\350'
186
+#define module_name (eight_bits)'\351' \
188
-#define new_module (eight_bits)0352 \
189
+#define new_module (eight_bits)'\352' \
191
#define cur_end cur_state.end_field
192
#define cur_byte cur_state.byte_field
193
@@ -247,20 +247,20 @@ copy_out(save_buffer,psave_buffer,!macro) \
194
#define NUMBER(lbl)out_label(PRINT_IF_0,(STMT_LBL)(lbl)) \
197
-#define PARENS copyd(TO_OUTPUT,XPN_CASES,050,051,NO) \
198
+#define PARENS copyd(TO_OUTPUT,XPN_CASES,'(',')',NO) \
201
-#define NL out_char(012)
202
-#define LP out_char(050)
203
-#define RP out_char(051)
204
-#define COMMA out_char(054)
205
-#define NOT out_char(041)
206
-#define EQUALS out_char(075)
207
-#define MINUS out_char(055)
208
+#define NL out_char('\n')
209
+#define LP out_char('(')
210
+#define RP out_char(')')
211
+#define COMMA out_char(',')
212
+#define NOT out_char('!')
213
+#define EQUALS out_char('=')
214
+#define MINUS out_char('-')
215
#define EQ_EQ out_char(eq_eq)
216
#define OR out_char(or_or)
217
-#define LT out_char(074)
218
-#define GT out_char(076) \
219
+#define LT out_char('<')
220
+#define GT out_char('>') \
222
#define IF(stmt_num)LABEL(stmt_num);id0(id__IF)
223
#define THEN id0(id__THEN);NL
224
@@ -289,7 +289,11 @@ copy_out(save_buffer,psave_buffer,!macro) \
226
#define cur_switch switches[switch_level] \
229
+#line 27 "./ratfor.web"
232
+#line 16 "./typedefs.hweb"
236
@@ -301,6 +305,9 @@ copy_out(save_buffer,psave_buffer,!macro) \
242
+#line 42 "./typedefs.hweb"
245
#if(part == 0 || part == 1)
246
@@ -314,19 +321,32 @@ copy_out(save_buffer,psave_buffer,!macro) \
251
+#line 28 "./ratfor.web"
255
+#line 440 "./typedefs.hweb"
257
#include "typedefs.h"
261
+#line 46 "./ratfor.web"
263
+#line 8 "./t_codes.hweb"
267
+#line 55 "./ratfor.web"
272
+#line 30 "./ratfor.web"
275
+#line 47 "./texts.hweb"
279
@@ -348,6 +368,9 @@ nbytes:19;
281
typedef text HUGE*text_pointer;
285
+#line 46 "./stacks.hweb"
289
@@ -363,6 +386,9 @@ eight_bits HUGE*macro_buf,HUGE*mp,HUGE*macro_buf_end;
291
typedef output_state HUGE*stack_pointer;
295
+#line 11 "./val.hweb"
299
@@ -397,7 +423,11 @@ VALUE value;
301
struct val HUGE*last,HUGE*next;
303
+#line 8 "./macs.hweb"
307
+#line 49 "./macs.hweb"
311
@@ -406,6 +436,9 @@ sixteen_bits token[MAX_XLEVELS];
317
+#line 19 "./trunc.hweb"
321
@@ -436,7 +469,11 @@ ASCII HUGE*id,HUGE*id_end;
322
BP HUGE*first,HUGE*last;
323
struct Trunc HUGE*next;
325
+#line 53 "./ratfor.web"
329
+#line 2413 "./ratfor.web"
332
IN_RATFOR int switch_level RSET(0);
333
@@ -469,12 +506,20 @@ boolean has_default;
335
IN_RATFOR SWITCH HUGE*switches;
338
+#line 31 "./ratfor.web"
341
+#line 59 "./ratfor.web"
347
+#line 32 "./ratfor.web"
350
+#line 426 "./typedefs.hweb"
354
@@ -488,6 +533,9 @@ IN_RATFOR SWITCH HUGE*switches;
360
+#line 69 "./texts.hweb"
363
EXTERN long max_texts;
364
@@ -515,7 +563,11 @@ EXTERN eight_bits HUGE*mx_tok_ptr,HUGE*mx_dtok_ptr;
367
EXTERN text_pointer macro_text;
368
+#line 8 "./stacks.hweb"
372
+#line 82 "./stacks.hweb"
375
EXTERN output_state cur_state;
376
@@ -525,7 +577,11 @@ EXTERN long stck_size;
377
EXTERN output_state HUGE*stack;
378
EXTERN stack_pointer stck_end;
379
EXTERN stack_pointer stck_ptr;
380
+#line 8 "./val.hweb"
384
+#line 58 "./macs.hweb"
387
IN_COMMON STMT_LBL max_stmt;
388
@@ -537,7 +593,11 @@ EXTERN sixteen_bits outp_line[NUM_LANGUAGES]
392
+#line 8 "./trunc.hweb"
396
+#line 68 "./ratfor.web"
399
EXTERN boolean mac_protected,in_string;
400
@@ -550,6 +610,9 @@ EXTERN eight_bits sent;
401
IN_COMMON STMT_LBL max_stmt;
402
IN_COMMON sixteen_bits outp_line[];
406
+#line 102 "./ratfor.web"
410
@@ -593,6 +656,7 @@ IN_RATFOR sixteen_bits
411
id__CONTAINS,id__CYCLE,id__ENDWHERE,id__INTERFACE,id__MODULE,
412
id__SELECT,id__TYPE,id__WHERE;
414
+#line 146 "./ratfor.web"
418
@@ -689,10 +753,16 @@ IN_RATFOR SPEC spec90_tokens[]
424
+#line 287 "./ratfor.web"
427
IN_RATFOR sixteen_bits sym_label RSET(0);
431
+#line 525 "./ratfor.web"
434
IN_RATFOR boolean saved_token RSET(NO);
435
@@ -701,12 +771,18 @@ IN_RATFOR int last_bytes;
441
+#line 659 "./ratfor.web"
444
IN_RATFOR eight_bits HUGE*cmnt_buf RSET(NULL),
445
HUGE*cmnt_buf_end RSET(NULL),
446
HUGE*cmnt_pos RSET(NULL);
450
+#line 781 "./ratfor.web"
454
@@ -727,21 +803,33 @@ IN_RATFOR int wlevel RSET(0);
460
+#line 884 "./ratfor.web"
463
IN_RATFOR boolean balanced RSET(YES);
464
IN_RATFOR ASCII cur_delim RSET('\0');
468
+#line 1316 "./ratfor.web"
471
IN_RATFOR eight_bits HUGE*save_buffer RSET(NULL),HUGE*psave_buffer;
475
+#line 1576 "./ratfor.web"
478
IN_RATFOR outer_char HUGE*cmd_fmt;
479
IN_RATFOR ASCII HUGE*cmd_msg,HUGE*cmd_end;
480
IN_RATFOR BUF_SIZE cmd_fsize,cmd_size;
484
+#line 2532 "./ratfor.web"
487
IN_COMMON double g_ratio;
488
@@ -750,11 +838,15 @@ IN_COMMON unsigned short marginal_cases;
490
IN_EVAL VAL HUGE*val_ptr,HUGE*val_heap;
493
+#line 33 "./ratfor.web"
500
+#line 82 "./ratfor.web"
504
@@ -763,6 +855,9 @@ is_Rat_present(VOID)
510
+#line 91 "./ratfor.web"
514
@@ -772,6 +867,9 @@ outer_char*msg C1("")
520
+#line 244 "./ratfor.web"
524
@@ -796,6 +894,8 @@ confusion(OC("ini_RAT_tokens"),OC("Language should be RATFOR-like here"));
527
ini_univ_tokens(language0);
529
+#line 271 "./ratfor.web"
533
@@ -803,15 +903,20 @@ ASCII HUGE*pd;
535
break_tokens[0]= LEFT(id_break,ID0);
536
break_tokens[1]= RIGHT(id_break);
537
-break_tokens[2]= 073;
538
+break_tokens[2]= ';';
540
pd= x_to_ASCII(OC("data"));
541
id_data= ID_NUM(pd,pd+4);
545
+#line 267 "./ratfor.web"
551
+#line 300 "./ratfor.web"
555
@@ -819,7 +924,7 @@ chk_lbl(VOID)
559
-if(next_byte()==072)
560
+if(next_byte()==':')
562
sym_label= (sixteen_bits)cur_val;
564
@@ -854,6 +959,9 @@ BACK_UP
570
+#line 349 "./ratfor.web"
574
@@ -906,6 +1014,9 @@ FREE_MEM(temp,"RAT_error:temp",N_MSGBUF,char);
575
FREE_MEM(temp1,"RAT_error:temp1",N_MSGBUF,char);
580
+#line 412 "./ratfor.web"
584
@@ -939,6 +1050,9 @@ RAT_error(ERROR,OC("Output ended %s"),1,temp);
585
fatal(ERR_R,OC("ABORTING!"),OC(""));
590
+#line 438 "./ratfor.web"
594
@@ -975,6 +1089,9 @@ default:return OC("UNKNOWN CMD");
600
+#line 476 "./ratfor.web"
604
@@ -986,6 +1103,9 @@ RAT_error(ERROR,OC("Misplaced keyword: \
605
\"%s\" must be used only inside \"switch\""),1,s);
610
+#line 487 "./ratfor.web"
612
SRTN didnt_expand FCN((c0,c,op))
614
@@ -997,6 +1117,9 @@ RAT_error(ERROR,OC("Was expecting '%c', not '%c', after \"%s\"; \
615
expansion aborted"),3,XCHR(c0),XCHR(c),op);
620
+#line 500 "./ratfor.web"
624
@@ -1013,6 +1136,9 @@ return NO;
630
+#line 536 "./ratfor.web"
634
@@ -1067,6 +1193,8 @@ last_bytes= 1;
639
+#line 599 "./ratfor.web"
642
a= IDENTIFIER(a0,last_a= *cur_byte++);
643
@@ -1120,6 +1248,8 @@ OUT_CHAR(module_number);
648
+#line 590 "./ratfor.web"
652
@@ -1128,6 +1258,9 @@ cur_val= cur_val0;
658
+#line 666 "./ratfor.web"
662
@@ -1142,7 +1275,7 @@ cmnt_pos= cmnt_buf= GET_MEM("cmnt_buf",SAVE8,eight_bits);
663
cmnt_buf_end= cmnt_buf+SAVE8;
666
-while((a= copy_comment(save_comments))==012);
667
+while((a= copy_comment(save_comments))=='\n');
670
output_ended(OC("while skipping newlines"),0);
671
@@ -1150,6 +1283,9 @@ output_ended(OC("while skipping newlines"),0);
677
+#line 691 "./ratfor.web"
680
copy_comment FCN((save_comments))
681
@@ -1184,6 +1320,9 @@ while((a= get_output())!=stringg);
682
DUMMY_RETURN(ignore);
687
+#line 728 "./ratfor.web"
691
@@ -1200,6 +1339,9 @@ FREE_MEM(cmnt_buf,"cmnt_buf",SAVE8,eight_bits);
692
cmnt_buf= cmnt_buf_end= cmnt_pos= NULL;
697
+#line 747 "./ratfor.web"
701
@@ -1215,6 +1357,9 @@ out_ptrunc(cur_val);
702
out_state= NUM_OR_ID;
707
+#line 810 "./ratfor.web"
711
@@ -1243,6 +1388,9 @@ icase= ignore;
717
+#line 845 "./ratfor.web"
721
@@ -1273,6 +1421,9 @@ OUT_CHAR(XORD(*p));
727
+#line 918 "./ratfor.web"
731
@@ -1293,16 +1444,18 @@ boolean found_semi;
732
boolean balanced0= balanced;
733
ASCII cur_delim0= cur_delim;
736
+#line 997 "./ratfor.web"
754
@@ -1310,9 +1463,11 @@ default:
755
confusion(OC("copyd"),OC("Invalid left delimiter 0x%x"),l);
759
+#line 938 "./ratfor.web"
762
-if(l==0173&&xpn_cases)
763
+if(l=='{'&&xpn_cases)
765
if(DONE_LEVEL&&!pop_level())
766
output_ended(OC("after '{'"),0);
767
@@ -1357,14 +1512,18 @@ a= (sixteen_bits)(*output_rtn)();
768
if(to_memory&&a==(sixteen_bits)stringg)
769
in_string= BOOLEAN(!in_string);
772
+if(!in_string)/* 76: */
773
+#line 1016 "./ratfor.web"
777
output_ended(OC("while scanning for '%c'. Scan began \
778
with delimiter '%c' at line %u"),3,XCHR(r),XCHR(l),starting_line);
780
if(a==(sixteen_bits)l)bal0[++bal]= 0;
781
-else if(a==(sixteen_bits)r)
782
+else if(a==(sixteen_bits)r)/* 77: */
783
+#line 1039 "./ratfor.web"
788
@@ -1385,14 +1544,14 @@ else OUT_CHAR(r0);
792
-if(semi_allowed&&last_token&&last_token!=073)
793
+if(semi_allowed&&last_token&&last_token!=';')
796
RAT_error(WARNING,OC("Supplied missing ';' before \
797
delimiter '%c'"),1,r);
799
-if(to_memory)SAVE_IN_MEM(073)
801
+if(to_memory)SAVE_IN_MEM(';')
805
if(to_memory)SAVE_IN_MEM(r)
806
@@ -1405,9 +1564,13 @@ break;
811
+#line 1022 "./ratfor.web"
813
else if(a==l0)bal0[bal]++;
815
+else if(a==r0)/* 78: */
816
+#line 1080 "./ratfor.web"
821
@@ -1418,10 +1581,12 @@ continue;
826
+#line 1024 "./ratfor.web"
832
if(semi_allowed)found_semi= YES;
834
RAT_error(ERROR,OC("Spurious semicolon"),0);
835
@@ -1433,9 +1598,13 @@ else last_token= a;
840
+#line 984 "./ratfor.web"
844
+if(to_memory)/* 79: */
845
+#line 1095 "./ratfor.web"
850
@@ -1456,6 +1625,8 @@ RAT_error(ERROR,OC("@o command not allowed inside switch"),0);
855
+#line 1128 "./ratfor.web"
859
@@ -1466,15 +1637,17 @@ a= IDENTIFIER(a0= (eight_bits)a,a1= next_byte());
863
-copyd(TO_MEMORY,DONT_XPN_CASES,050,051,NO);
864
+copyd(TO_MEMORY,DONT_XPN_CASES,'(',')',NO);
865
skip_newlines(COPY_COMMENTS);
866
-copyd(TO_MEMORY,DONT_XPN_CASES,0173,0175,YES);
867
+copyd(TO_MEMORY,DONT_XPN_CASES,'{','}',YES);
869
else if(a==id_case)x_case();
870
else if(a==id_default)x_default();
875
+#line 1115 "./ratfor.web"
879
@@ -1484,6 +1657,8 @@ SAVE_IN_MEM(next_byte())
884
+#line 986 "./ratfor.web"
888
@@ -1491,13 +1666,16 @@ balanced= balanced0;
889
cur_delim= cur_delim0;
894
+#line 1149 "./ratfor.web"
901
-copyd(TO_OUTPUT,XPN_CASES,0173,0175,YES);
902
+copyd(TO_OUTPUT,XPN_CASES,'{','}',YES);
906
@@ -1507,6 +1685,9 @@ rlevel--;
912
+#line 1222 "./ratfor.web"
916
@@ -1519,7 +1700,7 @@ sixteen_bits a;
918
skip_newlines(COPY_COMMENTS);
920
-if((a= next_byte())!=0173)
921
+if((a= next_byte())!='{')
924
output_ended(OC("at beginning of statement"),0);
925
@@ -1530,7 +1711,7 @@ if(brace_only)
927
RAT_error(WARNING,OC("Inserted '{'"),0);
929
-copyd(to_memory,XPN_CASES,0173,0175,YES);
930
+copyd(to_memory,XPN_CASES,'{','}',YES);
934
@@ -1556,11 +1737,14 @@ BACK_UP
938
-else copyd(to_memory,XPN_CASES,0173,0175,YES);
939
+else copyd(to_memory,XPN_CASES,'{','}',YES);
946
+#line 1277 "./ratfor.web"
950
@@ -1574,13 +1758,13 @@ if((a= get_output())==ignore)
951
output_ended(OC("during scan of simple \
954
-if(a==073&&!in_string)break;
955
+if(a==';'&&!in_string)break;
959
if((a= next_byte())!=stringg){BACK_UP return;}
961
-if(*cur_byte!=012){BACK_UP return;}
962
+if(*cur_byte!='\n'){BACK_UP return;}
966
@@ -1588,6 +1772,9 @@ while((a= get_output())!=stringg);
972
+#line 1337 "./ratfor.web"
976
@@ -1614,13 +1801,13 @@ p_end= p+nmax-1;
988
-l= (eight_bits)0173;
994
@@ -1647,6 +1834,8 @@ if(p>=p_end)resize(pp,nmax,&p,&p_end);
995
if(TOKEN1(a= next_byte()))
999
+#line 1411 "./ratfor.web"
1003
@@ -1654,7 +1843,9 @@ output_ended(OC("while scanning from line %u \
1004
for delimiter (r_before = '%c', r_after = '%c')"),3,starting_line,XCHR(r_before),XCHR(r_after));
1006
if(a==l)bal0[++bal]= 0;
1007
-else if(a==r_after&&r_after!=NOT_AFTER)
1008
+else if(a==r_after&&r_after!=NOT_AFTER)/* 88: */
1009
+#line 1430 "./ratfor.web"
1014
@@ -1666,11 +1857,11 @@ else
1018
-inserted(bal0[bal],0173,0175,l,bal);
1019
+inserted(bal0[bal],'{','}',l,bal);
1025
if(p>=p_end)resize(pp,nmax,&p,&p_end);
1028
@@ -1684,6 +1875,8 @@ return p;
1033
+#line 1418 "./ratfor.web"
1035
else if(a==r_before&&r_before!=NOT_BEFORE)
1037
@@ -1691,23 +1884,31 @@ BACK_UP;
1041
-else if(a==0173)bal0[bal]++;
1043
+else if(a=='{')bal0[bal]++;
1044
+else if(a=='}')/* 89: */
1045
+#line 1461 "./ratfor.web"
1051
-unmatched(0173,0175);
1052
+unmatched('{','}');
1059
+#line 1426 "./ratfor.web"
1064
+#line 1395 "./ratfor.web"
1068
+#line 1473 "./ratfor.web"
1072
@@ -1725,6 +1926,8 @@ break;
1077
+#line 1397 "./ratfor.web"
1081
@@ -1738,6 +1941,9 @@ DUMMY_RETURN(NULL);
1087
+#line 1491 "./ratfor.web"
1091
@@ -1750,6 +1956,9 @@ sprintf((char*)q0,delim?"'%c'":"?",XCHR(delim));
1097
+#line 1505 "./ratfor.web"
1101
@@ -1769,33 +1978,50 @@ old_len*sizeof(eight_bits));
1102
*pp_end= *pp+new_len-1;
1106
+#line 38 "./ratfor.web"
1112
+#line 1584 "./ratfor.web"
1119
+#line 802 "./ratfor.web"
1122
ALLOC(LBL,lbl,"lb",max_lbls,0);
1123
lbl_end= lbl+max_lbls;
1127
+#line 1593 "./ratfor.web"
1130
ALLOC(outer_char,cmd_fmt,"cf",cmd_fsize,0);
1131
ALLOC(ASCII,cmd_msg,"cg",cmd_size,0);
1132
cmd_end= cmd_msg+cmd_size;
1136
+#line 1720 "./ratfor.web"
1139
begun= GET_MEM("begun",max_lbls,BEGUN);
1142
+#line 1589 "./ratfor.web"
1148
+#line 1603 "./ratfor.web"
1152
@@ -1826,11 +2052,15 @@ fmt0= va_arg(arg_ptr,char*);
1153
va_arg(arg_ptr,int);
1157
+#line 1702 "./ratfor.web"
1160
static outer_char brkset[3]= "*?";
1165
boolean found_abbrev;
1168
@@ -1841,6 +2071,8 @@ if(suppress_cmds){if(found_abbrev)return;}
1169
else{if(!found_abbrev)return;}
1173
+#line 1633 "./ratfor.web"
1177
@@ -1853,6 +2085,8 @@ CONTINUE(ignore);
1179
nsprintf(cmd_fmt,OC("--- %s \"%s%s\" ---"),3,beginning,cmd_name(begun[rlevel-1].cmd),fmt0)>=(int)(cmd_fsize))OVERFLW("cmd_fmt","");
1182
+#line 1657 "./ratfor.web"
1186
@@ -1894,14 +2128,19 @@ va_end(arg_ptr);
1191
+#line 1644 "./ratfor.web"
1194
if(Fortran88&&symbolic_label)
1196
-id0(symbolic_label);OUT_CHAR(072);
1197
+id0(symbolic_label);OUT_CHAR(':');
1203
+#line 1725 "./ratfor.web"
1207
@@ -1919,6 +2158,9 @@ begun[rlevel].level= wlevel;
1213
+#line 1758 "./ratfor.web"
1217
@@ -1940,7 +2182,7 @@ didnt_expand('(',c,"while");
1221
-pa= SAVE_AFTER(&a,SAVE8,051);
1222
+pa= SAVE_AFTER(&a,SAVE8,')');
1225
out_cmd(YES,'w',OC(""),OC("(%s)"),2,a,pa);
1226
@@ -1971,6 +2213,9 @@ rlevel--;
1227
FREE_MEM(a,"while:a",SAVE8,eight_bits);
1232
+#line 1803 "./ratfor.web"
1236
@@ -1982,7 +2227,7 @@ sixteen_bits a;
1237
if(wlevel==0&&switch_level==0)
1239
NOT_LOOP("break"," or \"switch\"");
1245
@@ -2010,6 +2255,9 @@ char_after(';');
1251
+#line 1845 "./ratfor.web"
1255
@@ -2022,6 +2270,9 @@ RAT_error(WARNING,OC("Misplaced keyword: \
1256
\"%s\" must appear inside loop%s; command ignored"),2,id,msg);
1261
+#line 1860 "./ratfor.web"
1265
@@ -2033,7 +2284,7 @@ sixteen_bits a;
1268
NOT_LOOP("next","");
1274
@@ -2058,6 +2309,9 @@ char_after(';');
1280
+#line 1910 "./ratfor.web"
1284
@@ -2102,7 +2356,7 @@ didnt_expand('(',c,"until");
1288
-pu= SAVE_AFTER(&u,SAVE8,051);
1289
+pu= SAVE_AFTER(&u,SAVE8,')');
1291
out_cmd(NO,'p',OC(""),OC("(%s)"),2,u,pu);
1293
@@ -2123,6 +2377,9 @@ wlevel--;
1299
+#line 1981 "./ratfor.web"
1303
@@ -2156,7 +2413,7 @@ BACK_UP
1307
-id0(id__DO);if(!Fortran88)LABEL(s_next);COPY_2TO(0173,073);NL;
1308
+id0(id__DO);if(!Fortran88)LABEL(s_next);COPY_2TO('{',';');NL;
1312
@@ -2177,6 +2434,9 @@ wlevel--;
1318
+#line 2059 "./ratfor.web"
1322
@@ -2199,9 +2459,9 @@ didnt_expand('(',c,"for");
1326
-pa= SAVE_AFTER(&a,SAVE8,073);
1327
-pb= SAVE_AFTER(&b,SAVE8,073);
1328
-pc= SAVE_AFTER(&c,SAVE8,051);
1329
+pa= SAVE_AFTER(&a,SAVE8,';');
1330
+pb= SAVE_AFTER(&b,SAVE8,';');
1331
+pc= SAVE_AFTER(&c,SAVE8,')');
1334
out_cmd(YES,'f',OC(""),OC("(%s;%s;%s)"),6,a,pa,b,pb,c,pc);
1335
@@ -2237,6 +2497,9 @@ FREE_MEM(b,"for:b",SAVE8,eight_bits);
1336
FREE_MEM(c,"for:c",SAVE8,eight_bits);
1341
+#line 2131 "./ratfor.web"
1345
@@ -2259,6 +2522,9 @@ rlevel--;
1351
+#line 2152 "./ratfor.web"
1355
@@ -2278,6 +2544,9 @@ stmt(TO_OUTPUT,0);
1361
+#line 2172 "./ratfor.web"
1365
@@ -2342,6 +2611,9 @@ return NO;
1371
+#line 2238 "./ratfor.web"
1375
@@ -2356,6 +2628,9 @@ x_els_if(VOID)
1376
UNEXPECTED("elseif");
1381
+#line 2256 "./ratfor.web"
1385
@@ -2418,6 +2693,9 @@ x_until(VOID)
1386
UNEXPECTED("until");
1391
+#line 2338 "./ratfor.web"
1395
@@ -2435,6 +2713,9 @@ ENDWHERE;
1401
+#line 2357 "./ratfor.web"
1405
@@ -2445,6 +2726,9 @@ CONST outer_char id[]C1("Error message.")
1406
RAT_error(WARNING,OC("Unexpected keyword \"%s\" ignored"),1,id);
1411
+#line 2454 "./ratfor.web"
1415
@@ -2488,7 +2772,7 @@ didnt_expand('(',c,"switch");
1419
-pa= SAVE_AFTER(&a,SAVE8,051);
1420
+pa= SAVE_AFTER(&a,SAVE8,')');
1423
out_cmd(YES,'s',OC(""),OC("(%s)"),2,a,pa);
1424
@@ -2504,7 +2788,9 @@ if(Fortran88)
1430
+#line 2541 "./ratfor.web"
1435
@@ -2573,9 +2859,13 @@ mcases<max_spread)?YES:
1440
+#line 2503 "./ratfor.web"
1444
+if(computed_goto)/* 127: */
1445
+#line 2614 "./ratfor.web"
1450
@@ -2613,8 +2903,12 @@ rlevel--;
1455
+#line 2505 "./ratfor.web"
1458
+#line 2655 "./ratfor.web"
1462
boolean case_ended_with_break= NO;
1463
boolean made_temp= YES;
1464
@@ -2634,6 +2928,8 @@ id0(icase);EQUALS;copy_out(a,pa,!macro);NL;
1467
for(k= 1;k<=cur_switch.ncases;k++)
1469
+#line 2737 "./ratfor.web"
1472
cur_case= &cur_switch.cases[k];
1473
@@ -2642,6 +2938,8 @@ if(Fortran88)
1474
if(k==1)s_case= max_stmt++;
1478
+#line 2798 "./ratfor.web"
1481
CASE HUGE*last_case= &cur_switch.cases[k-1];
1482
@@ -2653,6 +2951,8 @@ BOOLEAN(MEMCMP(last_case->txt.next-3,break_tokens,3)==0);
1483
else case_ended_with_break= NO;
1487
+#line 2745 "./ratfor.web"
1489
if(!case_ended_with_break){GOTO(s_case);}
1491
@@ -2666,10 +2966,10 @@ id0(id__CASE);
1492
if(cur_case->is_default)id0(id__DEFAULT);
1495
-if(*cur_case->case_txt.start!=050)LP;
1496
+if(*cur_case->case_txt.start!='(')LP;
1497
copy_out(cur_case->case_txt.start,cur_case->case_txt.next,
1499
-if(*(cur_case->case_txt.next-1)!=051)RP;
1500
+if(*(cur_case->case_txt.next-1)!=')')RP;
1504
@@ -2703,6 +3003,8 @@ copy_out(cur_case->txt.start,cur_case->txt.next,!macro);
1509
+#line 2673 "./ratfor.web"
1513
@@ -2715,6 +3017,8 @@ GOTO(s_default);
1518
+#line 2506 "./ratfor.web"
1522
@@ -2734,6 +3038,9 @@ switch_level--;
1523
FREE_MEM(a,"switch:a",SAVE8,eight_bits);
1528
+#line 2687 "./ratfor.web"
1532
@@ -2754,6 +3061,9 @@ out_cmd(NO,'c',OC(""),OC(" %s:"),2,cur_case->case_txt.start,cur_case->case_txt.n
1538
+#line 2710 "./ratfor.web"
1542
@@ -2780,6 +3090,9 @@ if(cur_case->is_default)return s_default;
1548
+#line 2810 "./ratfor.web"
1552
@@ -2791,6 +3104,8 @@ return;
1554
expanding(case_CMD);
1557
+#line 2832 "./ratfor.web"
1560
*cur_case->txt.next= '\0';
1561
@@ -2813,10 +3128,14 @@ cur_case->txt.end= cur_case->txt.start+BIG_SAVE8;
1563
cur_case->txt.next= cur_case->txt.start;
1566
+#line 2821 "./ratfor.web"
1568
-cur_case->case_txt.next= SAVE_AFTER(&cur_case->case_txt.start,SAVE8,072);
1569
+cur_case->case_txt.next= SAVE_AFTER(&cur_case->case_txt.start,SAVE8,':');
1570
cur_case->is_default= NO;
1573
+#line 2855 "./ratfor.web"
1577
@@ -2838,11 +3157,16 @@ break;
1582
+#line 2825 "./ratfor.web"
1590
+#line 2878 "./ratfor.web"
1594
@@ -2861,6 +3185,8 @@ if(cur_switch.has_default)
1595
RAT_error(ERROR,OC("Only one default allowed per switch"),0);
1596
else cur_switch.has_default= YES;
1599
+#line 2832 "./ratfor.web"
1602
*cur_case->txt.next= '\0';
1603
@@ -2883,6 +3209,8 @@ cur_case->txt.end= cur_case->txt.start+BIG_SAVE8;
1605
cur_case->txt.next= cur_case->txt.start;
1608
+#line 2895 "./ratfor.web"
1610
cur_case->case_txt.next= cur_case->case_txt.start;
1611
cur_case->is_default= YES;
1612
@@ -2893,6 +3221,9 @@ char_after(':');
1618
+#line 3083 "./ratfor.web"
1622
@@ -2909,7 +3240,7 @@ WHILE()
1626
-if(!(a==040||a==tab_mark))
1627
+if(!(a==' '||a==tab_mark))
1631
@@ -2933,19 +3264,19 @@ id0(id_program);id0(cur_fcn);
1633
if(cur_fcn==id_procedure)
1640
b= next_byte();BACK_UP
1645
skip_newlines(COPY_COMMENTS);
1647
copy_out(insert.program.start,insert.program.end,!macro);
1649
-COPY_2TO(0173,NOT_AFTER);
1651
+COPY_2TO('{',NOT_AFTER);
1652
if(psave_buffer>save_buffer)NL;
1654
stmt(TO_OUTPUT,BRACE_ONLY);
1655
@@ -2975,7 +3306,7 @@ WHILE()
1659
-if(!(a==040||a==tab_mark))
1660
+if(!(a==' '||a==tab_mark))
1664
@@ -2999,19 +3330,19 @@ id0(id_module);id0(cur_fcn);
1666
if(cur_fcn==id_procedure)
1673
b= next_byte();BACK_UP
1678
skip_newlines(COPY_COMMENTS);
1680
copy_out(insert.module.start,insert.module.end,!macro);
1682
-COPY_2TO(0173,NOT_AFTER);
1684
+COPY_2TO('{',NOT_AFTER);
1685
if(psave_buffer>save_buffer)NL;
1687
stmt(TO_OUTPUT,BRACE_ONLY);
1688
@@ -3041,7 +3372,7 @@ WHILE()
1692
-if(!(a==040||a==tab_mark))
1693
+if(!(a==' '||a==tab_mark))
1697
@@ -3065,19 +3396,19 @@ id0(id_subroutine);id0(cur_fcn);
1699
if(cur_fcn==id_procedure)
1706
b= next_byte();BACK_UP
1711
skip_newlines(COPY_COMMENTS);
1713
copy_out(insert.subroutine.start,insert.subroutine.end,!macro);
1715
-COPY_2TO(0173,NOT_AFTER);
1717
+COPY_2TO('{',NOT_AFTER);
1718
if(psave_buffer>save_buffer)NL;
1720
stmt(TO_OUTPUT,BRACE_ONLY);
1721
@@ -3107,7 +3438,7 @@ WHILE()
1725
-if(!(a==040||a==tab_mark))
1726
+if(!(a==' '||a==tab_mark))
1730
@@ -3131,19 +3462,19 @@ id0(id_function);id0(cur_fcn);
1732
if(cur_fcn==id_procedure)
1739
b= next_byte();BACK_UP
1744
skip_newlines(COPY_COMMENTS);
1746
copy_out(insert.function.start,insert.function.end,!macro);
1748
-COPY_2TO(0173,NOT_AFTER);
1750
+COPY_2TO('{',NOT_AFTER);
1751
if(psave_buffer>save_buffer)NL;
1753
stmt(TO_OUTPUT,BRACE_ONLY);
1754
@@ -3173,7 +3504,7 @@ WHILE()
1758
-if(!(a==040||a==tab_mark))
1759
+if(!(a==' '||a==tab_mark))
1763
@@ -3197,19 +3528,19 @@ id0(id_blockdata);id0(cur_fcn);
1765
if(cur_fcn==id_procedure)
1772
b= next_byte();BACK_UP
1777
skip_newlines(COPY_COMMENTS);
1779
copy_out(insert.blockdata.start,insert.blockdata.end,!macro);
1781
-COPY_2TO(0173,NOT_AFTER);
1783
+COPY_2TO('{',NOT_AFTER);
1784
if(psave_buffer>save_buffer)NL;
1786
stmt(TO_OUTPUT,BRACE_ONLY);
1787
@@ -3239,7 +3570,7 @@ WHILE()
1791
-if(!(a==040||a==tab_mark))
1792
+if(!(a==' '||a==tab_mark))
1796
@@ -3263,19 +3594,19 @@ id0(id_interface);id0(cur_fcn);
1798
if(cur_fcn==id_procedure)
1805
b= next_byte();BACK_UP
1810
skip_newlines(COPY_COMMENTS);
1812
copy_out(insert.interface.start,insert.interface.end,!macro);
1814
-COPY_2TO(0173,NOT_AFTER);
1816
+COPY_2TO('{',NOT_AFTER);
1817
if(psave_buffer>save_buffer)NL;
1819
stmt(TO_OUTPUT,BRACE_ONLY);
1820
@@ -3292,6 +3623,9 @@ cur_fcn= NO_FCN;
1826
+#line 3093 "./ratfor.web"
1830
@@ -3317,6 +3651,9 @@ id0(a);
1836
+#line 3135 "./ratfor.web"
1840
@@ -3329,6 +3666,9 @@ NL;
1846
+#line 3210 "./ratfor.web"
1850
@@ -3338,8 +3678,8 @@ sixteen_bits a;
1853
b= next_byte();BACK_UP
1861
@@ -3373,7 +3713,13 @@ char_after(';');OUT_CHAR(';');
1867
+#line 3215 "./ratfor.web"
1871
+#line 3219 "./ratfor.web"
1875
@@ -3384,7 +3730,7 @@ eight_bits HUGE*return_expr= NULL,HUGE*pr;
1876
expanding(return_CMD);
1879
-if((pr= SAVE_AFTER(&return_expr,SAVE8,073))>return_expr)
1880
+if((pr= SAVE_AFTER(&return_expr,SAVE8,';'))>return_expr)
1884
@@ -3403,6 +3749,9 @@ rlevel--;
1885
FREE_MEM(return_expr,"return_expr",SAVE8,eight_bits);
1890
+#line 3250 "./ratfor.web"
1894
@@ -3434,7 +3783,7 @@ return;
1898
-pI= SAVE_AFTER(&I,SAVE8,054);
1899
+pI= SAVE_AFTER(&I,SAVE8,',');
1903
@@ -3444,13 +3793,13 @@ expansion aborted"),0);
1907
-pImin= SAVE_AFTER(&Imin,SAVE8,054);
1908
+pImin= SAVE_AFTER(&Imin,SAVE8,',');
1909
imin= neval(Imin,pImin);
1911
-pImax= SAVE_AFTER(&Imax,SAVE8,054);
1912
+pImax= SAVE_AFTER(&Imax,SAVE8,',');
1913
imax= neval(Imax,pImax);
1915
-pDi= SAVE_AFTER(&Di,SAVE8,051);
1916
+pDi= SAVE_AFTER(&Di,SAVE8,')');
1920
@@ -3458,7 +3807,7 @@ skip_newlines(NO);
1924
-if(!(c==0173||c==050))
1925
+if(!(c=='{'||c=='('))
1928
RAT_error(ERROR,OC("Was expecting '{' or '(', not '%c', after $DO(); \
1929
@@ -3469,7 +3818,7 @@ return;
1933
-ptxt= SAVE_AFTER(&txt,BIG_SAVE8,c==0173?0175:051);
1934
+ptxt= SAVE_AFTER(&txt,BIG_SAVE8,c=='{'?'}':')');
1937
n= name_dir+IDENTIFIER(*I,*(I+1));
1938
@@ -3507,6 +3856,9 @@ FREE_MEM(Imax,"unroll:Imax",SAVE8,eight_bits);
1939
FREE_MEM(txt,"unroll:txt",SAVE8,eight_bits);
1944
+#line 3347 "./ratfor.web"
1948
@@ -3526,10 +3878,15 @@ insert.interface.start= insert.interface.end=
1949
GET_MEM("interface",2,eight_bits);
1953
+#line 42 "./ratfor.web"
1957
+#line 1 "./typedefs.hweb"
1960
+#line 8 "./formats.hweb"