@@ -9,7 +9,7 @@ diff -ruNpw SOURCE/COMPILER/sc2.c SOURCE_patched/COMPILER/sc2.c
99 static cell litchar(const unsigned char **lptr,int flags);
1010 static symbol *find_symbol(const symbol *root,const char *name,int fnumber,int automaton,int *cmptag);
1111
12- @@ -1724,32 +1725,136 @@ SC_FUNC void preprocess(void)
12+ @@ -1724,32 +1725,140 @@ SC_FUNC void preprocess(void)
1313 } while (iscommand!=CMD_NONE && iscommand!=CMD_TERM && freading); /* enddo */
1414 }
1515
@@ -37,7 +37,8 @@ diff -ruNpw SOURCE/COMPILER/sc2.c SOURCE_patched/COMPILER/sc2.c
3737+ lptr--;
3838+ instring=1;
3939+ *flags |= STRINGIZE;
40- + } else if (*lptr==')' || *lptr==',' || *lptr=='}' || *lptr==';' || *lptr=='\r' || *lptr=='\n') {
40+ + } else if (*lptr==')' || *lptr==',' || *lptr=='}' || *lptr==';' |
41+ + *lptr==':' || *lptr=='\r' || *lptr=='\n') {
4142+ break;
4243+ } else if (*lptr!=' ' && *lptr!='\t') {
4344+ error(1,"-string end-","-identifier-");
@@ -59,7 +60,8 @@ diff -ruNpw SOURCE/COMPILER/sc2.c SOURCE_patched/COMPILER/sc2.c
5960+ lptr=stringize+1;
6061+ *flags &= ~STRINGIZE;
6162+ continue;
62- + } else if (*stringize==',' || *stringize==')' || *stringize=='}' || *stringize==';') { /* end */
63+ + } else if (*stringize==',' || *stringize==')' || *stringize=='}' ||
64+ + *stringize==';' || *stringize==':') { /* end */
6365+ lptr=stringize;
6466+ break;
6567+ } else if (*stringize=='\0') {
@@ -78,9 +80,9 @@ diff -ruNpw SOURCE/COMPILER/sc2.c SOURCE_patched/COMPILER/sc2.c
7880 } /* while */
7981- litadd(0); /* terminate string */
8082+ litadd(0);
81- +
83+ +
8284+ if (*lptr==',' || *lptr==')' || *lptr=='}' || *lptr==';' ||
83- + *lptr=='\n' || *lptr=='\r')
85+ + *lptr==':' || *lptr==' \n' || *lptr=='\r')
8486+ lptr=stringize; /* backtrack to end of last string for closing " */
8587 return lptr;
8688 }
@@ -92,7 +94,7 @@ diff -ruNpw SOURCE/COMPILER/sc2.c SOURCE_patched/COMPILER/sc2.c
9294 ucell val,c;
9395+ unsigned char *stringize;
9496+ int instring=1;
95- + if (*flags & STRINGIZE)
97+ + if (*flags & STRINGIZE)
9698+ while (*lptr==' ' || *lptr=='\t')
9799+ lptr++;
98100
@@ -113,7 +115,8 @@ diff -ruNpw SOURCE/COMPILER/sc2.c SOURCE_patched/COMPILER/sc2.c
113115+ lptr--;
114116+ instring=1;
115117+ *flags |= STRINGIZE;
116- + } else if (*lptr==')' || *lptr==',' || *lptr=='}' || *lptr==';' || *lptr=='\r' || *lptr=='\n') {
118+ + } else if (*lptr==')' || *lptr==',' || *lptr=='}' || *lptr==';' ||
119+ + *lptr==':' || *lptr=='\r' || *lptr=='\n') {
117120+ break;
118121+ } else if (*lptr!=' ' && *lptr!='\t') {
119122+ error(1,"-string end-","-identifier-");
@@ -135,7 +138,8 @@ diff -ruNpw SOURCE/COMPILER/sc2.c SOURCE_patched/COMPILER/sc2.c
135138+ lptr=stringize+1;
136139+ *flags &= ~STRINGIZE;
137140+ continue;
138- + } else if (*stringize==',' || *stringize==')' || *stringize=='}' || *stringize==';') { /* end */
141+ + } else if (*stringize==',' || *stringize==')' || *stringize=='}' |
142+ + *stringize==';' || *stringize==':') { /* end */
139143+ lptr=stringize;
140144+ break;
141145+ } else if (*stringize=='\0') {
@@ -167,7 +171,7 @@ diff -ruNpw SOURCE/COMPILER/sc2.c SOURCE_patched/COMPILER/sc2.c
167171 litadd(0); /* add full cell of zeros */
168172+
169173+ if (*lptr==',' || *lptr==')' || *lptr=='}' || *lptr==';' ||
170- + *lptr=='\n' || *lptr=='\r')
174+ + *lptr==':' || *lptr==' \n' || *lptr=='\r')
171175+ lptr=stringize; /* backtrack to end of last string for closing " */
172176 return lptr;
173177 }
0 commit comments