Move as much as possible out of scan.c.patch and stage1scan.c.patch into scan.l
authorNick Downing <downing.nick@gmail.com>
Thu, 26 Jul 2018 01:06:03 +0000 (11:06 +1000)
committerNick Downing <downing.nick@gmail.com>
Thu, 26 Jul 2018 01:06:03 +0000 (11:06 +1000)
src/scan.c
src/scan.c.patch
src/scan.l
src/stage1scan.c.patch

index 95f27bf..5f1846b 100644 (file)
 
 /* end standard C headers. */
 
-char piece_temp[100];
-char *piece[10000];
-int piece0;
-int piece1;
-void piece_append(const char *str) {
- piece[piece1++] = strdup(str);
-}
-void piece_insert(int n, const char *str) {
- memmove(piece + n + 1, piece + n, (piece1 - n) * sizeof(char *));
- piece[n] = strdup(str);
- ++piece1;
-}
-
 /* flex integer type definitions */
 
 #ifndef FLEXINT_H
@@ -199,11 +186,6 @@ extern FILE *yyin, *yyout;
        while ( 0 )
 
 #if 1
-#define flush() \
- do { \
-  piece_esc(yytext, yy_c_buf_p - yytext); \
-  yytext = yy_c_buf_p; \
- } while (0)
 #define unput(c) \
  do { \
   piece_esc(yytext, yy_c_buf_p - yytext); \
@@ -7787,9 +7769,111 @@ extern const char *escaped_qstart, *escaped_qend;
 } while (0)
 
 /* Nick */
+char piece_temp[100];
+char *piece[10000];
+int piece0;
+int piece1;
+void piece_append(const char *str) {
+ piece[piece1++] = strdup(str);
+}
+void piece_insert(int n, const char *str) {
+ memmove(piece + n + 1, piece + n, (piece1 - n) * sizeof(char *));
+ piece[n] = strdup(str);
+ ++piece1;
+}
+
+#define flush() \
+ do { \
+  piece_esc(yytext, yy_c_buf_p - yytext); \
+  yytext = yy_c_buf_p; \
+ } while (0)
+
 static void markup_action(const char *text);
 static void markup_option(const char *name, int sense);
 
+static int real_yylex(void);
+static void piece_esc(const char *p, size_t n) {
+ size_t i, j = 0;
+ for (i = 0; i < n; ++i)
+  switch (p[i]) {
+  case '<':
+  case '>':
+   j += 4;
+   break;
+  case '&':
+   j += 5;
+   break;
+  default:
+   ++j;
+   break;
+  }
+ char *q = malloc(j + 1);
+ j = 0;
+ for (i = 0; i < n; ++i)
+  switch (p[i]) {
+  case '<':
+   memcpy(q + j, "&lt;", 4);
+   j += 4;
+   break;
+  case '>':
+   memcpy(q + j, "&gt;", 4);
+   j += 4;
+   break;
+  case '&':
+   memcpy(q + j, "&amp;", 5);
+   j += 5;
+   break;
+  default:
+   q[j++] = p[i];
+   break;
+  }
+ q[j] = 0;
+ piece[piece1++] = q;
+}
+static void piece_pack() {
+ int i;
+ size_t j = 0;
+ for (i = piece0; i < piece1; ++i)
+  j += strlen(piece[i]);
+ char *q = malloc(j + 1);
+ j = 0;
+ for (i = piece0; i < piece1; ++i) {
+  int k = strlen(piece[i]);
+  memcpy(q + j, piece[i], k);
+  free(piece[i]);
+  j += k;
+ }
+ q[j] = 0;
+ piece[piece0++] = q;
+ piece1 = piece0;
+}
+YY_DECL
+{
+ int result = real_yylex();
+ if (result < 0)
+  return ~result;
+ piece_pack();
+#if 1
+ piece_esc(yytext, strlen(yytext));
+#else
+ size_t n = strlen(yytext);
+ if (n) {
+  sprintf(piece_temp, "<token value=\"%d\">", result);
+  piece_append(piece_temp);
+  piece_esc(yytext, n);
+  piece_append("</token>");
+ }
+ else {
+  sprintf(piece_temp, "<token value=\"%d\" />", result);
+  piece_append(piece_temp);
+ }
+#endif
+ piece_pack();
+ return result;
+}
+#undef YY_DECL
+#define YY_DECL static int real_yylex(void)
+
 
 
 
@@ -7799,7 +7883,7 @@ static void markup_option(const char *name, int sense);
 
 
 
-#line 7776 "scan.c"
+#line 7878 "scan.c"
 
 #define INITIAL 0
 #define SECT2 1
@@ -8017,93 +8101,13 @@ extern int yylex (void);
 
 /** The main scanner function which does all the work.
  */
-static int real_yylex(void);
-static void piece_esc(const char *p, size_t n) {
- size_t i, j = 0;
- for (i = 0; i < n; ++i)
-  switch (p[i]) {
-  case '<':
-  case '>':
-   j += 4;
-   break;
-  case '&':
-   j += 5;
-   break;
-  default:
-   ++j;
-   break;
-  }
- char *q = malloc(j + 1);
- j = 0;
- for (i = 0; i < n; ++i)
-  switch (p[i]) {
-  case '<':
-   memcpy(q + j, "&lt;", 4);
-   j += 4;
-   break;
-  case '>':
-   memcpy(q + j, "&gt;", 4);
-   j += 4;
-   break;
-  case '&':
-   memcpy(q + j, "&amp;", 5);
-   j += 5;
-   break;
-  default:
-   q[j++] = p[i];
-   break;
-  }
- q[j] = 0;
- piece[piece1++] = q;
-}
-static void piece_pack() {
- int i;
- size_t j = 0;
- for (i = piece0; i < piece1; ++i)
-  j += strlen(piece[i]);
- char *q = malloc(j + 1);
- j = 0;
- for (i = piece0; i < piece1; ++i) {
-  int k = strlen(piece[i]);
-  memcpy(q + j, piece[i], k);
-  free(piece[i]);
-  j += k;
- }
- q[j] = 0;
- piece[piece0++] = q;
- piece1 = piece0;
-}
 YY_DECL
-{
- int result = real_yylex();
- if (result < 0)
-  return ~result;
- piece_pack();
-#if 1
- piece_esc(yytext, strlen(yytext));
-#else
- size_t n = strlen(yytext);
- if (n) {
-  sprintf(piece_temp, "<token value=\"%d\">", result);
-  piece_append(piece_temp);
-  piece_esc(yytext, n);
-  piece_append("</token>");
- }
- else {
-  sprintf(piece_temp, "<token value=\"%d\" />", result);
-  piece_append(piece_temp);
- }
-#endif
- piece_pack();
- return result;
-}
-static int real_yylex(void)
 {
        register yy_state_type yy_current_state;
        register char *yy_cp, *yy_bp;
        register int yy_act;
     
-#line 173 "scan.l"
+#line 275 "scan.l"
 
        static int bracelevel, didadef, indented_code;
        static int doing_rule_action = false;
@@ -8114,7 +8118,7 @@ static int real_yylex(void)
        char nmdef[MAXLINE];
 
 
-#line 8011 "scan.c"
+#line 8113 "scan.c"
 
        if ( !(yy_init) )
                {
@@ -8209,39 +8213,39 @@ do_action:      /* This label is used only to access EOF actions. */
 
 case 1:
 YY_RULE_SETUP
-#line 184 "scan.l"
+#line 286 "scan.l"
 START_CODEBLOCK(true); piece_append("<PLex_Text>");
        YY_BREAK
 case 2:
 YY_RULE_SETUP
-#line 185 "scan.l"
+#line 287 "scan.l"
 add_action("/*[""["); yy_push_state( COMMENT );
        YY_BREAK
 case 3:
 YY_RULE_SETUP
-#line 186 "scan.l"
+#line 288 "scan.l"
 yy_push_state( LINEDIR );
        YY_BREAK
 case 4:
 YY_RULE_SETUP
-#line 187 "scan.l"
+#line 289 "scan.l"
 return SCDECL;
        YY_BREAK
 case 5:
 YY_RULE_SETUP
-#line 188 "scan.l"
+#line 290 "scan.l"
 return XSCDECL;
        YY_BREAK
 case 6:
 /* rule 6 can match eol */
 YY_RULE_SETUP
-#line 189 "scan.l"
+#line 291 "scan.l"
 START_CODEBLOCK(false); flush(); piece_append("<PLex_Text>");
        YY_BREAK
 case 7:
 /* rule 7 can match eol */
 YY_RULE_SETUP
-#line 190 "scan.l"
+#line 292 "scan.l"
 {
                 brace_start_line = linenum;
                 ++linenum;
@@ -8252,17 +8256,17 @@ YY_RULE_SETUP
        YY_BREAK
 case 8:
 YY_RULE_SETUP
-#line 198 "scan.l"
+#line 300 "scan.l"
 synerr( _("malformed '%top' directive") );
        YY_BREAK
 case 9:
 YY_RULE_SETUP
-#line 200 "scan.l"
+#line 302 "scan.l"
 /* discard */
        YY_BREAK
 case 10:
 YY_RULE_SETUP
-#line 202 "scan.l"
+#line 304 "scan.l"
 {
                        sectnum = 2;
                        bracelevel = 0;
@@ -8284,42 +8288,42 @@ YY_RULE_SETUP
 case 11:
 /* rule 11 can match eol */
 YY_RULE_SETUP
-#line 220 "scan.l"
+#line 322 "scan.l"
 yytext_is_array = false; ++linenum; piece_append("<PLex_Section1_Options><PLex_Section1_Options_Array>"); { int i = strlen(yytext) - 1; piece_esc(yytext, i); yytext += i; } piece_append("</PLex_Section1_Options_Array></PLex_Section1_Options>"); 
        YY_BREAK
 case 12:
 /* rule 12 can match eol */
 YY_RULE_SETUP
-#line 221 "scan.l"
+#line 323 "scan.l"
 yytext_is_array = true; ++linenum; piece_append("<PLex_Section1_Options><PLex_Section1_Options_Array value=\"true\">"); { int i = strlen(yytext) - 1; piece_esc(yytext, i); yytext += i; } piece_append("</PLex_Section1_Options_Array></PLex_Section1_Options>");
        YY_BREAK
 case 13:
 YY_RULE_SETUP
-#line 223 "scan.l"
+#line 325 "scan.l"
 BEGIN(OPTION); return TOK_OPTION;
        YY_BREAK
 case 14:
 /* rule 14 can match eol */
 YY_RULE_SETUP
-#line 225 "scan.l"
+#line 327 "scan.l"
 ++linenum; /* ignore */
        YY_BREAK
 case 15:
 /* rule 15 can match eol */
 YY_RULE_SETUP
-#line 226 "scan.l"
+#line 328 "scan.l"
 ++linenum;     /* ignore */
        YY_BREAK
 /* xgettext: no-c-format */
 case 16:
 /* rule 16 can match eol */
 YY_RULE_SETUP
-#line 229 "scan.l"
+#line 331 "scan.l"
 synerr( _( "unrecognized '%' directive" ) );
        YY_BREAK
 case 17:
 YY_RULE_SETUP
-#line 231 "scan.l"
+#line 333 "scan.l"
 {
                        if(yyleng < MAXLINE)
                         {
@@ -8337,51 +8341,51 @@ YY_RULE_SETUP
        YY_BREAK
 case 18:
 YY_RULE_SETUP
-#line 246 "scan.l"
+#line 348 "scan.l"
 RETURNNAME;
        YY_BREAK
 case 19:
 /* rule 19 can match eol */
 YY_RULE_SETUP
-#line 247 "scan.l"
+#line 349 "scan.l"
 ++linenum; /* allows blank lines in section 1 */
        YY_BREAK
 case 20:
 /* rule 20 can match eol */
 YY_RULE_SETUP
-#line 248 "scan.l"
+#line 350 "scan.l"
 ACTION_ECHO; ++linenum; /* maybe end of comment line */
        YY_BREAK
 
 /* */
 case 21:
 YY_RULE_SETUP
-#line 253 "scan.l"
+#line 355 "scan.l"
 ACTION_ECHO;
        YY_BREAK
 case 22:
 YY_RULE_SETUP
-#line 254 "scan.l"
+#line 356 "scan.l"
 ACTION_ECHO;
        YY_BREAK
 case 23:
 /* rule 23 can match eol */
 YY_RULE_SETUP
-#line 256 "scan.l"
+#line 358 "scan.l"
 ++linenum; ACTION_ECHO;
        YY_BREAK
 
 
 case 24:
 YY_RULE_SETUP
-#line 259 "scan.l"
+#line 361 "scan.l"
 add_action("*/]""]"); yy_pop_state();
        YY_BREAK
 
 
 case 25:
 YY_RULE_SETUP
-#line 262 "scan.l"
+#line 364 "scan.l"
 ACTION_ECHO; yy_pop_state();
        YY_BREAK
 
@@ -8389,41 +8393,41 @@ ACTION_ECHO; yy_pop_state();
 /* This is the same as COMMENT, but is discarded rather than output. */
 case 26:
 YY_RULE_SETUP
-#line 267 "scan.l"
+#line 369 "scan.l"
 yy_pop_state();
        YY_BREAK
 case 27:
 YY_RULE_SETUP
-#line 268 "scan.l"
+#line 370 "scan.l"
 ;
        YY_BREAK
 case 28:
 YY_RULE_SETUP
-#line 269 "scan.l"
+#line 371 "scan.l"
 ;
        YY_BREAK
 case 29:
 /* rule 29 can match eol */
 YY_RULE_SETUP
-#line 270 "scan.l"
+#line 372 "scan.l"
 ++linenum;
        YY_BREAK
 
 
 case 30:
 YY_RULE_SETUP
-#line 274 "scan.l"
+#line 376 "scan.l"
 yy_pop_state();
        YY_BREAK
 case 31:
 YY_RULE_SETUP
-#line 275 "scan.l"
+#line 377 "scan.l"
 ;
        YY_BREAK
 case 32:
 /* rule 32 can match eol */
 YY_RULE_SETUP
-#line 276 "scan.l"
+#line 378 "scan.l"
 ++linenum;
        YY_BREAK
 
@@ -8431,17 +8435,17 @@ YY_RULE_SETUP
 case 33:
 /* rule 33 can match eol */
 YY_RULE_SETUP
-#line 280 "scan.l"
+#line 382 "scan.l"
 yy_pop_state();
        YY_BREAK
 case 34:
 YY_RULE_SETUP
-#line 281 "scan.l"
+#line 383 "scan.l"
 linenum = myctoi( yytext );
        YY_BREAK
 case 35:
 YY_RULE_SETUP
-#line 283 "scan.l"
+#line 385 "scan.l"
 {
                        free(infilename);
                        infilename = xstrdup(yytext + 1);
@@ -8450,19 +8454,19 @@ YY_RULE_SETUP
        YY_BREAK
 case 36:
 YY_RULE_SETUP
-#line 288 "scan.l"
+#line 390 "scan.l"
 /* ignore spurious characters */
        YY_BREAK
 
 
 case 37:
 YY_RULE_SETUP
-#line 291 "scan.l"
+#line 393 "scan.l"
 ACTION_ECHO_QSTART;
        YY_BREAK
 case 38:
 YY_RULE_SETUP
-#line 292 "scan.l"
+#line 394 "scan.l"
 ACTION_ECHO_QEND;
        YY_BREAK
 
@@ -8470,23 +8474,23 @@ ACTION_ECHO_QEND;
 case 39:
 /* rule 39 can match eol */
 YY_RULE_SETUP
-#line 296 "scan.l"
+#line 398 "scan.l"
 ++linenum; piece_append("</PLex_Text>"); flush(); END_CODEBLOCK;
        YY_BREAK
 case 40:
 YY_RULE_SETUP
-#line 297 "scan.l"
+#line 399 "scan.l"
 ACTION_ECHO;
        YY_BREAK
 case 41:
 YY_RULE_SETUP
-#line 298 "scan.l"
+#line 400 "scan.l"
 ACTION_ECHO;
        YY_BREAK
 case 42:
 /* rule 42 can match eol */
 YY_RULE_SETUP
-#line 299 "scan.l"
+#line 401 "scan.l"
 {
                        ++linenum;
                        ACTION_ECHO;
@@ -8497,7 +8501,7 @@ YY_RULE_SETUP
 
 case 43:
 YY_RULE_SETUP
-#line 307 "scan.l"
+#line 409 "scan.l"
 {
                 if( --brace_depth == 0){
                     /* TODO: Matched. */
@@ -8508,7 +8512,7 @@ YY_RULE_SETUP
        YY_BREAK
 case 44:
 YY_RULE_SETUP
-#line 315 "scan.l"
+#line 417 "scan.l"
 {
                 brace_depth++;
                 buf_strnappend(&top_buf, yytext, yyleng);
@@ -8517,7 +8521,7 @@ YY_RULE_SETUP
 case 45:
 /* rule 45 can match eol */
 YY_RULE_SETUP
-#line 320 "scan.l"
+#line 422 "scan.l"
 {
                 ++linenum;
                 buf_strnappend(&top_buf, yytext, yyleng);
@@ -8525,23 +8529,23 @@ YY_RULE_SETUP
        YY_BREAK
 case 46:
 YY_RULE_SETUP
-#line 325 "scan.l"
+#line 427 "scan.l"
 buf_strnappend(&top_buf, escaped_qstart, (int) strlen(escaped_qstart));
        YY_BREAK
 case 47:
 YY_RULE_SETUP
-#line 326 "scan.l"
+#line 428 "scan.l"
 buf_strnappend(&top_buf, escaped_qend, (int) strlen(escaped_qend));
        YY_BREAK
 case 48:
 YY_RULE_SETUP
-#line 327 "scan.l"
+#line 429 "scan.l"
 {
        buf_strnappend(&top_buf, yytext, yyleng);
     }
        YY_BREAK
 case YY_STATE_EOF(CODEBLOCK_MATCH_BRACE):
-#line 331 "scan.l"
+#line 433 "scan.l"
 {
                 linenum = brace_start_line;
                 synerr(_("Unmatched '{'"));
@@ -8552,12 +8556,12 @@ case YY_STATE_EOF(CODEBLOCK_MATCH_BRACE):
 
 case 49:
 YY_RULE_SETUP
-#line 340 "scan.l"
+#line 442 "scan.l"
 /* separates name and definition */
        YY_BREAK
 case 50:
 YY_RULE_SETUP
-#line 342 "scan.l"
+#line 444 "scan.l"
 {
                        if(yyleng < MAXLINE)
                         {
@@ -8583,7 +8587,7 @@ YY_RULE_SETUP
 case 51:
 /* rule 51 can match eol */
 YY_RULE_SETUP
-#line 364 "scan.l"
+#line 466 "scan.l"
 {
                        if ( ! didadef )
                                synerr( _( "incomplete name definition" ) );
@@ -8596,42 +8600,42 @@ YY_RULE_SETUP
 case 52:
 /* rule 52 can match eol */
 YY_RULE_SETUP
-#line 374 "scan.l"
+#line 476 "scan.l"
 ++linenum; BEGIN(INITIAL);
        YY_BREAK
 case 53:
 YY_RULE_SETUP
-#line 375 "scan.l"
+#line 477 "scan.l"
 option_sense = true;
        YY_BREAK
 case 54:
 YY_RULE_SETUP
-#line 377 "scan.l"
+#line 479 "scan.l"
 return '=';
        YY_BREAK
 case 55:
 YY_RULE_SETUP
-#line 379 "scan.l"
+#line 481 "scan.l"
 option_sense = ! option_sense;
        YY_BREAK
 case 56:
 YY_RULE_SETUP
-#line 381 "scan.l"
+#line 483 "scan.l"
 csize = option_sense ? 128 : 256; markup_option("SevenBit", option_sense);
        YY_BREAK
 case 57:
 YY_RULE_SETUP
-#line 382 "scan.l"
+#line 484 "scan.l"
 csize = option_sense ? 256 : 128; markup_option("SevenBit", !option_sense);
        YY_BREAK
 case 58:
 YY_RULE_SETUP
-#line 384 "scan.l"
+#line 486 "scan.l"
 long_align = option_sense; markup_option("Align", option_sense);
        YY_BREAK
 case 59:
 YY_RULE_SETUP
-#line 385 "scan.l"
+#line 487 "scan.l"
 {
                        ACTION_M4_IFDEF( "M4""_YY_ALWAYS_INTERACTIVE", option_sense );
             interactive = option_sense;
@@ -8640,27 +8644,27 @@ YY_RULE_SETUP
        YY_BREAK
 case 60:
 YY_RULE_SETUP
-#line 390 "scan.l"
+#line 492 "scan.l"
 yytext_is_array = option_sense; markup_option("Array", option_sense);
        YY_BREAK
 case 61:
 YY_RULE_SETUP
-#line 391 "scan.l"
+#line 493 "scan.l"
 backing_up_report = option_sense; markup_option("Backup", option_sense);
        YY_BREAK
 case 62:
 YY_RULE_SETUP
-#line 392 "scan.l"
+#line 494 "scan.l"
 interactive = ! option_sense; markup_option("Interactive", !option_sense);
        YY_BREAK
 case 63:
 YY_RULE_SETUP
-#line 393 "scan.l"
+#line 495 "scan.l"
 bison_bridge_lval = option_sense; markup_option("BisonBridge", option_sense);
        YY_BREAK
 case 64:
 YY_RULE_SETUP
-#line 394 "scan.l"
+#line 496 "scan.l"
 { if((bison_bridge_lloc = option_sense))
                             bison_bridge_lval = true;
  markup_option("BisonLocations", option_sense);
@@ -8668,37 +8672,37 @@ YY_RULE_SETUP
        YY_BREAK
 case 65:
 YY_RULE_SETUP
-#line 398 "scan.l"
+#line 500 "scan.l"
 C_plus_plus = option_sense; markup_option("CPlusPlus", option_sense);
        YY_BREAK
 case 66:
 YY_RULE_SETUP
-#line 399 "scan.l"
+#line 501 "scan.l"
 sf_set_case_ins(!option_sense); markup_option("Caseless", !option_sense);
        YY_BREAK
 case 67:
 YY_RULE_SETUP
-#line 400 "scan.l"
+#line 502 "scan.l"
 sf_set_case_ins(option_sense); markup_option("Caseless", option_sense);
        YY_BREAK
 case 68:
 YY_RULE_SETUP
-#line 401 "scan.l"
+#line 503 "scan.l"
 ddebug = option_sense; markup_option("Debug", option_sense);
        YY_BREAK
 case 69:
 YY_RULE_SETUP
-#line 402 "scan.l"
+#line 504 "scan.l"
 spprdflt = ! option_sense; markup_option("Default", option_sense);
        YY_BREAK
 case 70:
 YY_RULE_SETUP
-#line 403 "scan.l"
+#line 505 "scan.l"
 useecs = option_sense; markup_option("ECS", option_sense);
        YY_BREAK
 case 71:
 YY_RULE_SETUP
-#line 404 "scan.l"
+#line 506 "scan.l"
 {
                        useecs = usemecs = false;
                        use_read = fullspd = true;
@@ -8707,7 +8711,7 @@ YY_RULE_SETUP
        YY_BREAK
 case 72:
 YY_RULE_SETUP
-#line 409 "scan.l"
+#line 511 "scan.l"
 {
                        useecs = usemecs = false;
                        use_read = fulltbl = true;
@@ -8716,32 +8720,32 @@ YY_RULE_SETUP
        YY_BREAK
 case 73:
 YY_RULE_SETUP
-#line 414 "scan.l"
+#line 516 "scan.l"
 ACTION_IFDEF("YY_NO_INPUT", ! option_sense); markup_option("Input", option_sense);
        YY_BREAK
 case 74:
 YY_RULE_SETUP
-#line 415 "scan.l"
+#line 517 "scan.l"
 interactive = option_sense; markup_option("Interactive", option_sense);
        YY_BREAK
 case 75:
 YY_RULE_SETUP
-#line 416 "scan.l"
+#line 518 "scan.l"
 lex_compat = option_sense; markup_option("LexCompat", option_sense);
        YY_BREAK
 case 76:
 YY_RULE_SETUP
-#line 417 "scan.l"
+#line 519 "scan.l"
 posix_compat = option_sense; markup_option("PosixCompat", option_sense);
        YY_BREAK
 case 77:
 YY_RULE_SETUP
-#line 418 "scan.l"
+#line 520 "scan.l"
 gen_line_dirs = option_sense; markup_option("Line", option_sense);
        YY_BREAK
 case 78:
 YY_RULE_SETUP
-#line 419 "scan.l"
+#line 521 "scan.l"
 {
                        ACTION_M4_IFDEF( "M4""_YY_MAIN", option_sense);
             /* Override yywrap */
@@ -8752,12 +8756,12 @@ YY_RULE_SETUP
        YY_BREAK
 case 79:
 YY_RULE_SETUP
-#line 426 "scan.l"
+#line 528 "scan.l"
 usemecs = option_sense; markup_option("MetaECS", option_sense);
        YY_BREAK
 case 80:
 YY_RULE_SETUP
-#line 427 "scan.l"
+#line 529 "scan.l"
 {
                        ACTION_M4_IFDEF( "M4""_YY_NEVER_INTERACTIVE", option_sense );
             interactive = !option_sense;
@@ -8766,237 +8770,237 @@ YY_RULE_SETUP
        YY_BREAK
 case 81:
 YY_RULE_SETUP
-#line 432 "scan.l"
+#line 534 "scan.l"
 performance_report += option_sense ? 1 : -1; markup_option("PerfReport", option_sense);
        YY_BREAK
 case 82:
 YY_RULE_SETUP
-#line 433 "scan.l"
+#line 535 "scan.l"
 yytext_is_array = ! option_sense; markup_option("Array", !option_sense);
        YY_BREAK
 case 83:
 YY_RULE_SETUP
-#line 434 "scan.l"
+#line 536 "scan.l"
 use_read = option_sense; markup_option("Read", option_sense);
        YY_BREAK
 case 84:
 YY_RULE_SETUP
-#line 435 "scan.l"
+#line 537 "scan.l"
 reentrant = option_sense; markup_option("Reentrant", option_sense);
        YY_BREAK
 case 85:
 YY_RULE_SETUP
-#line 436 "scan.l"
+#line 538 "scan.l"
 reject_really_used = option_sense; markup_option("Reject", option_sense);
        YY_BREAK
 case 86:
 YY_RULE_SETUP
-#line 437 "scan.l"
+#line 539 "scan.l"
 ACTION_M4_IFDEF( "M4""_YY_STACK_USED", option_sense ); markup_option("Stack", option_sense);
        YY_BREAK
 case 87:
 YY_RULE_SETUP
-#line 438 "scan.l"
+#line 540 "scan.l"
 do_stdinit = option_sense; markup_option("StdInit", option_sense);
        YY_BREAK
 case 88:
 YY_RULE_SETUP
-#line 439 "scan.l"
+#line 541 "scan.l"
 use_stdout = option_sense; markup_option("StdOut", option_sense);
        YY_BREAK
 case 89:
 YY_RULE_SETUP
-#line 440 "scan.l"
+#line 542 "scan.l"
 ACTION_IFDEF("YY_NO_UNISTD_H", ! option_sense); markup_option("UniStd", option_sense);
        YY_BREAK
 case 90:
 YY_RULE_SETUP
-#line 441 "scan.l"
+#line 543 "scan.l"
 ACTION_M4_IFDEF("M4""_YY_NO_UNPUT", ! option_sense); markup_option("Unput", option_sense);
        YY_BREAK
 case 91:
 YY_RULE_SETUP
-#line 442 "scan.l"
+#line 544 "scan.l"
 printstats = option_sense; markup_option("Verbose", option_sense);
        YY_BREAK
 case 92:
 YY_RULE_SETUP
-#line 443 "scan.l"
+#line 545 "scan.l"
 nowarn = ! option_sense; markup_option("Warn", option_sense);
        YY_BREAK
 case 93:
 YY_RULE_SETUP
-#line 444 "scan.l"
+#line 546 "scan.l"
 do_yylineno = option_sense; ACTION_M4_IFDEF("M4""_YY_USE_LINENO", option_sense); markup_option("YYLineNo", option_sense);
        YY_BREAK
 case 94:
 YY_RULE_SETUP
-#line 445 "scan.l"
+#line 547 "scan.l"
 yymore_really_used = option_sense; markup_option("YYMore", option_sense);
        YY_BREAK
 case 95:
 YY_RULE_SETUP
-#line 446 "scan.l"
+#line 548 "scan.l"
 do_yywrap = option_sense; markup_option("YYWrap", option_sense);
        YY_BREAK
 case 96:
 YY_RULE_SETUP
-#line 448 "scan.l"
+#line 550 "scan.l"
 ACTION_M4_IFDEF("M4""_YY_NO_PUSH_STATE", ! option_sense); markup_option("YYPushState", option_sense);
        YY_BREAK
 case 97:
 YY_RULE_SETUP
-#line 449 "scan.l"
+#line 551 "scan.l"
 ACTION_M4_IFDEF("M4""_YY_NO_POP_STATE", ! option_sense); markup_option("YYPopState", option_sense);
        YY_BREAK
 case 98:
 YY_RULE_SETUP
-#line 450 "scan.l"
+#line 552 "scan.l"
 ACTION_M4_IFDEF("M4""_YY_NO_TOP_STATE", ! option_sense); markup_option("YYTopState", option_sense);
        YY_BREAK
 case 99:
 YY_RULE_SETUP
-#line 452 "scan.l"
+#line 554 "scan.l"
 ACTION_M4_IFDEF("M4""_YY_NO_SCAN_BUFFER", ! option_sense); markup_option("YYScanBuffer", option_sense);
        YY_BREAK
 case 100:
 YY_RULE_SETUP
-#line 453 "scan.l"
+#line 555 "scan.l"
 ACTION_M4_IFDEF("M4""_YY_NO_SCAN_BYTES", ! option_sense); markup_option("YYScanBytes", option_sense);
        YY_BREAK
 case 101:
 YY_RULE_SETUP
-#line 454 "scan.l"
+#line 556 "scan.l"
 ACTION_M4_IFDEF("M4""_YY_NO_SCAN_STRING", ! option_sense); markup_option("YYScanString", option_sense);
        YY_BREAK
 case 102:
 YY_RULE_SETUP
-#line 456 "scan.l"
+#line 558 "scan.l"
 ACTION_M4_IFDEF("M4""_YY_NO_FLEX_ALLOC", ! option_sense); markup_option("YYAlloc", option_sense);
        YY_BREAK
 case 103:
 YY_RULE_SETUP
-#line 457 "scan.l"
+#line 559 "scan.l"
 ACTION_M4_IFDEF("M4""_YY_NO_FLEX_REALLOC", ! option_sense); markup_option("YYRealloc", option_sense);
        YY_BREAK
 case 104:
 YY_RULE_SETUP
-#line 458 "scan.l"
+#line 560 "scan.l"
 ACTION_M4_IFDEF("M4""_YY_NO_FLEX_FREE", ! option_sense); markup_option("YYFree", option_sense);
        YY_BREAK
 case 105:
 YY_RULE_SETUP
-#line 460 "scan.l"
+#line 562 "scan.l"
 ACTION_M4_IFDEF("M4""_YY_NO_GET_DEBUG", ! option_sense); markup_option("YYGetDebug", option_sense);
        YY_BREAK
 case 106:
 YY_RULE_SETUP
-#line 461 "scan.l"
+#line 563 "scan.l"
 ACTION_M4_IFDEF("M4""_YY_NO_SET_DEBUG", ! option_sense); markup_option("YYSetDebug", option_sense);
        YY_BREAK
 case 107:
 YY_RULE_SETUP
-#line 462 "scan.l"
+#line 564 "scan.l"
 ACTION_M4_IFDEF("M4""_YY_NO_GET_EXTRA", ! option_sense); markup_option("YYGetExtra", option_sense);
        YY_BREAK
 case 108:
 YY_RULE_SETUP
-#line 463 "scan.l"
+#line 565 "scan.l"
 ACTION_M4_IFDEF("M4""_YY_NO_SET_EXTRA", ! option_sense); markup_option("YYSetExtra", option_sense);
        YY_BREAK
 case 109:
 YY_RULE_SETUP
-#line 464 "scan.l"
+#line 566 "scan.l"
 ACTION_M4_IFDEF("M4""_YY_NO_GET_LENG", ! option_sense); markup_option("YYGetLeng", option_sense);
        YY_BREAK
 case 110:
 YY_RULE_SETUP
-#line 465 "scan.l"
+#line 567 "scan.l"
 ACTION_M4_IFDEF("M4""_YY_NO_GET_TEXT", ! option_sense); markup_option("YYGetText", option_sense);
        YY_BREAK
 case 111:
 YY_RULE_SETUP
-#line 466 "scan.l"
+#line 568 "scan.l"
 ACTION_M4_IFDEF("M4""_YY_NO_GET_LINENO", ! option_sense); markup_option("YYGetLineNo", option_sense);
        YY_BREAK
 case 112:
 YY_RULE_SETUP
-#line 467 "scan.l"
+#line 569 "scan.l"
 ACTION_M4_IFDEF("M4""_YY_NO_SET_LINENO", ! option_sense); markup_option("YYSetLineNo", option_sense);
        YY_BREAK
 case 113:
 YY_RULE_SETUP
-#line 468 "scan.l"
+#line 570 "scan.l"
 ACTION_M4_IFDEF("M4""_YY_NO_GET_IN", ! option_sense); markup_option("YYGetIn", option_sense);
        YY_BREAK
 case 114:
 YY_RULE_SETUP
-#line 469 "scan.l"
+#line 571 "scan.l"
 ACTION_M4_IFDEF("M4""_YY_NO_SET_IN", ! option_sense); markup_option("YYSetIn", option_sense);
        YY_BREAK
 case 115:
 YY_RULE_SETUP
-#line 470 "scan.l"
+#line 572 "scan.l"
 ACTION_M4_IFDEF("M4""_YY_NO_GET_OUT", ! option_sense); markup_option("YYGetOut", option_sense);
        YY_BREAK
 case 116:
 YY_RULE_SETUP
-#line 471 "scan.l"
+#line 573 "scan.l"
 ACTION_M4_IFDEF("M4""_YY_NO_SET_OUT", ! option_sense); markup_option("YYSetOut", option_sense);
        YY_BREAK
 case 117:
 YY_RULE_SETUP
-#line 472 "scan.l"
+#line 574 "scan.l"
 ACTION_M4_IFDEF("M4""_YY_NO_GET_LVAL", ! option_sense); markup_option("YYGetLVal", option_sense);
        YY_BREAK
 case 118:
 YY_RULE_SETUP
-#line 473 "scan.l"
+#line 575 "scan.l"
 ACTION_M4_IFDEF("M4""_YY_NO_SET_LVAL", ! option_sense); markup_option("YYSetLVal", option_sense);
        YY_BREAK
 case 119:
 YY_RULE_SETUP
-#line 474 "scan.l"
+#line 576 "scan.l"
 ACTION_M4_IFDEF("M4""_YY_NO_GET_LLOC", ! option_sense); markup_option("YYGetLLoc", option_sense);
        YY_BREAK
 case 120:
 YY_RULE_SETUP
-#line 475 "scan.l"
+#line 577 "scan.l"
 ACTION_M4_IFDEF("M4""_YY_NO_SET_LLOC", ! option_sense); markup_option("YYSetLLoc", option_sense);
        YY_BREAK
 case 121:
 YY_RULE_SETUP
-#line 477 "scan.l"
+#line 579 "scan.l"
 return TOK_EXTRA_TYPE;
        YY_BREAK
 case 122:
 YY_RULE_SETUP
-#line 478 "scan.l"
+#line 580 "scan.l"
 return TOK_OUTFILE;
        YY_BREAK
 case 123:
 YY_RULE_SETUP
-#line 479 "scan.l"
+#line 581 "scan.l"
 return TOK_PREFIX;
        YY_BREAK
 case 124:
 YY_RULE_SETUP
-#line 480 "scan.l"
+#line 582 "scan.l"
 return TOK_YYCLASS;
        YY_BREAK
 case 125:
 YY_RULE_SETUP
-#line 481 "scan.l"
+#line 583 "scan.l"
 return TOK_HEADER_FILE;
        YY_BREAK
 case 126:
 YY_RULE_SETUP
-#line 482 "scan.l"
+#line 584 "scan.l"
 return TOK_TABLES_FILE;
        YY_BREAK
 case 127:
 YY_RULE_SETUP
-#line 483 "scan.l"
+#line 585 "scan.l"
 {
                     tablesverify = option_sense;
                     if(!tablesext && option_sense)
@@ -9006,7 +9010,7 @@ YY_RULE_SETUP
        YY_BREAK
 case 128:
 YY_RULE_SETUP
-#line 491 "scan.l"
+#line 593 "scan.l"
 {
                        if(yyleng-1 < MAXLINE)
                         {
@@ -9032,7 +9036,7 @@ YY_RULE_SETUP
        YY_BREAK
 case 129:
 YY_RULE_SETUP
-#line 514 "scan.l"
+#line 616 "scan.l"
 {
                        format_synerr( _( "unrecognized %%option: %s" ),
                                yytext );
@@ -9043,28 +9047,28 @@ YY_RULE_SETUP
 case 130:
 /* rule 130 can match eol */
 YY_RULE_SETUP
-#line 521 "scan.l"
+#line 623 "scan.l"
 ++linenum; BEGIN(INITIAL);
        YY_BREAK
 
 case 131:
 YY_RULE_SETUP
-#line 525 "scan.l"
+#line 627 "scan.l"
 ++bracelevel; yyless( 2 );     /* eat only %{ */
        YY_BREAK
 case 132:
 YY_RULE_SETUP
-#line 526 "scan.l"
+#line 628 "scan.l"
 --bracelevel; yyless( 2 );     /* eat only %} */
        YY_BREAK
 case 133:
 YY_RULE_SETUP
-#line 528 "scan.l"
+#line 630 "scan.l"
 START_CODEBLOCK(true); piece_append("<PLex_Text>"); /* indented code in prolog */
        YY_BREAK
 case 134:
 YY_RULE_SETUP
-#line 530 "scan.l"
+#line 632 "scan.l"
 {
         /* non-indented code */
                if ( bracelevel <= 0 ) {
@@ -9081,17 +9085,17 @@ YY_RULE_SETUP
        YY_BREAK
 case 135:
 YY_RULE_SETUP
-#line 544 "scan.l"
+#line 646 "scan.l"
 ACTION_ECHO;
        YY_BREAK
 case 136:
 /* rule 136 can match eol */
 YY_RULE_SETUP
-#line 545 "scan.l"
+#line 647 "scan.l"
 ++linenum; ACTION_ECHO;
        YY_BREAK
 case YY_STATE_EOF(SECT2PROLOG):
-#line 547 "scan.l"
+#line 649 "scan.l"
 {
                        mark_prolog();
                        sectnum = 0;
@@ -9110,12 +9114,12 @@ case YY_STATE_EOF(SECT2PROLOG):
 case 137:
 /* rule 137 can match eol */
 YY_RULE_SETUP
-#line 562 "scan.l"
+#line 664 "scan.l"
 ++linenum; /* allow blank lines in section 2 */
        YY_BREAK
 case 138:
 YY_RULE_SETUP
-#line 564 "scan.l"
+#line 666 "scan.l"
 {
                        indented_code = false;
                        doing_codeblock = true;
@@ -9131,7 +9135,7 @@ YY_RULE_SETUP
        YY_BREAK
 case 139:
 YY_RULE_SETUP
-#line 577 "scan.l"
+#line 679 "scan.l"
 {
                         /* Allow "<" to appear in (?x) patterns. */
                         if (!sf_skip_ws())
@@ -9141,12 +9145,12 @@ YY_RULE_SETUP
        YY_BREAK
 case 140:
 YY_RULE_SETUP
-#line 583 "scan.l"
+#line 685 "scan.l"
 return '^';
        YY_BREAK
 case 141:
 YY_RULE_SETUP
-#line 584 "scan.l"
+#line 686 "scan.l"
 BEGIN(QUOTE); return '"';
        YY_BREAK
 case 142:
@@ -9154,7 +9158,7 @@ case 142:
 (yy_c_buf_p) = yy_cp = yy_bp + 1;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
-#line 585 "scan.l"
+#line 687 "scan.l"
 {
                        BEGIN(NUM);
                        if ( lex_compat || posix_compat )
@@ -9169,12 +9173,12 @@ case 143:
 (yy_c_buf_p) = yy_cp = yy_bp + 1;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
-#line 592 "scan.l"
+#line 694 "scan.l"
 return '$';
        YY_BREAK
 case 144:
 YY_RULE_SETUP
-#line 594 "scan.l"
+#line 696 "scan.l"
 {
                        bracelevel = 1;
                        BEGIN(PERCENT_BRACE_ACTION);
@@ -9208,7 +9212,7 @@ YY_RULE_SETUP
 case 145:
 /* rule 145 can match eol */
 YY_RULE_SETUP
-#line 623 "scan.l"
+#line 725 "scan.l"
 {
                         if (sf_skip_ws()){
                             /* We're in the middle of a (?x: ) pattern. */
@@ -9240,7 +9244,7 @@ YY_RULE_SETUP
        YY_BREAK
 case 146:
 YY_RULE_SETUP
-#line 652 "scan.l"
+#line 754 "scan.l"
 {
 
                 if (sf_skip_ws()){
@@ -9257,12 +9261,12 @@ YY_RULE_SETUP
        YY_BREAK
 case 147:
 YY_RULE_SETUP
-#line 666 "scan.l"
+#line 768 "scan.l"
 /* allow indented rules */ ;
        YY_BREAK
 case 148:
 YY_RULE_SETUP
-#line 668 "scan.l"
+#line 770 "scan.l"
 {
             if (sf_skip_ws()){
                 /* We're in the middle of a (?x: ) pattern. */
@@ -9296,7 +9300,7 @@ YY_RULE_SETUP
 case 149:
 /* rule 149 can match eol */
 YY_RULE_SETUP
-#line 698 "scan.l"
+#line 800 "scan.l"
 {
             if (sf_skip_ws()){
                 /* We're in the middle of a (?x: ) pattern. */
@@ -9330,15 +9334,15 @@ YY_RULE_SETUP
                        }
        YY_BREAK
 case 150:
-#line 731 "scan.l"
+#line 833 "scan.l"
 case 151:
 YY_RULE_SETUP
-#line 731 "scan.l"
+#line 833 "scan.l"
 return EOF_OP;
        YY_BREAK
 case 152:
 YY_RULE_SETUP
-#line 733 "scan.l"
+#line 835 "scan.l"
 {
                        sectnum = 3;
                        BEGIN(no_section3_escape ? SECT3_NOESCAPE : SECT3);
@@ -9358,7 +9362,7 @@ YY_RULE_SETUP
        YY_BREAK
 case 153:
 YY_RULE_SETUP
-#line 750 "scan.l"
+#line 852 "scan.l"
 {
                        int cclval;
 
@@ -9408,12 +9412,12 @@ YY_RULE_SETUP
        YY_BREAK
 case 154:
 YY_RULE_SETUP
-#line 796 "scan.l"
+#line 898 "scan.l"
 return CCL_OP_DIFF;
        YY_BREAK
 case 155:
 YY_RULE_SETUP
-#line 797 "scan.l"
+#line 899 "scan.l"
 return CCL_OP_UNION;
        YY_BREAK
 /* Check for :space: at the end of the rule so we don't
@@ -9423,7 +9427,7 @@ return CCL_OP_UNION;
 case 156:
 /* rule 156 can match eol */
 YY_RULE_SETUP
-#line 804 "scan.l"
+#line 906 "scan.l"
 {
                        char *nmdefptr;
             int end_is_ws, end_ch;
@@ -9478,7 +9482,7 @@ nmstr[yyleng - 2 - end_is_ws] = '\0';  /* chop trailing brace */
        YY_BREAK
 case 157:
 YY_RULE_SETUP
-#line 856 "scan.l"
+#line 958 "scan.l"
 {
                     if (sf_skip_ws())
                         yy_push_state(COMMENT_DISCARD);
@@ -9491,7 +9495,7 @@ YY_RULE_SETUP
        YY_BREAK
 case 158:
 YY_RULE_SETUP
-#line 866 "scan.l"
+#line 968 "scan.l"
 {
                     if (lex_compat || posix_compat){
                         /* Push back the "?#" and treat it like a normal parens. */
@@ -9505,7 +9509,7 @@ YY_RULE_SETUP
        YY_BREAK
 case 159:
 YY_RULE_SETUP
-#line 876 "scan.l"
+#line 978 "scan.l"
 {
                     sf_push();
                     if (lex_compat || posix_compat)
@@ -9518,12 +9522,12 @@ YY_RULE_SETUP
        YY_BREAK
 case 160:
 YY_RULE_SETUP
-#line 885 "scan.l"
+#line 987 "scan.l"
 sf_push(); return '(';
        YY_BREAK
 case 161:
 YY_RULE_SETUP
-#line 886 "scan.l"
+#line 988 "scan.l"
 {
                     if (_sf_top_ix > 0) {
                         sf_pop();
@@ -9534,17 +9538,17 @@ YY_RULE_SETUP
        YY_BREAK
 case 162:
 YY_RULE_SETUP
-#line 894 "scan.l"
+#line 996 "scan.l"
 return (unsigned char) yytext[0];
        YY_BREAK
 case 163:
 YY_RULE_SETUP
-#line 895 "scan.l"
+#line 997 "scan.l"
 RETURNCHAR;
        YY_BREAK
 /* Nick added this rule for consistency with rest of scanner */
 case YY_STATE_EOF(SECT2):
-#line 898 "scan.l"
+#line 1000 "scan.l"
 {
                        sectnum = 0;
 #if 1
@@ -9562,17 +9566,17 @@ case YY_STATE_EOF(SECT2):
 case 164:
 /* rule 164 can match eol */
 YY_RULE_SETUP
-#line 913 "scan.l"
+#line 1015 "scan.l"
 ++linenum;     /* Allow blank lines & continuations */
        YY_BREAK
 case 165:
 YY_RULE_SETUP
-#line 914 "scan.l"
+#line 1016 "scan.l"
 return (unsigned char) yytext[0];
        YY_BREAK
 case 166:
 YY_RULE_SETUP
-#line 915 "scan.l"
+#line 1017 "scan.l"
 BEGIN(SECT2); return '>';
        YY_BREAK
 case 167:
@@ -9580,17 +9584,17 @@ case 167:
 (yy_c_buf_p) = yy_cp = yy_bp + 1;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
-#line 916 "scan.l"
+#line 1018 "scan.l"
 BEGIN(CARETISBOL); return '>';
        YY_BREAK
 case 168:
 YY_RULE_SETUP
-#line 917 "scan.l"
+#line 1019 "scan.l"
 RETURNNAME;
        YY_BREAK
 case 169:
 YY_RULE_SETUP
-#line 918 "scan.l"
+#line 1020 "scan.l"
 {
                        format_synerr( _( "bad <start condition>: %s" ),
                                yytext );
@@ -9599,24 +9603,24 @@ YY_RULE_SETUP
 
 case 170:
 YY_RULE_SETUP
-#line 924 "scan.l"
+#line 1026 "scan.l"
 BEGIN(SECT2); return '^';
        YY_BREAK
 
 case 171:
 YY_RULE_SETUP
-#line 928 "scan.l"
+#line 1030 "scan.l"
 RETURNCHAR;
        YY_BREAK
 case 172:
 YY_RULE_SETUP
-#line 929 "scan.l"
+#line 1031 "scan.l"
 BEGIN(SECT2); return '"';
        YY_BREAK
 case 173:
 /* rule 173 can match eol */
 YY_RULE_SETUP
-#line 931 "scan.l"
+#line 1033 "scan.l"
 {
                        synerr( _( "missing quote" ) );
                        BEGIN(SECT2);
@@ -9628,49 +9632,49 @@ YY_RULE_SETUP
 
 case 174:
 YY_RULE_SETUP
-#line 940 "scan.l"
+#line 1042 "scan.l"
 BEGIN(SECT2);
        YY_BREAK
 case 175:
 YY_RULE_SETUP
-#line 941 "scan.l"
+#line 1043 "scan.l"
 BEGIN(GROUP_MINUS_PARAMS);
        YY_BREAK
 case 176:
 YY_RULE_SETUP
-#line 942 "scan.l"
+#line 1044 "scan.l"
 sf_set_case_ins(1);
        YY_BREAK
 case 177:
 YY_RULE_SETUP
-#line 943 "scan.l"
+#line 1045 "scan.l"
 sf_set_dot_all(1);
        YY_BREAK
 case 178:
 YY_RULE_SETUP
-#line 944 "scan.l"
+#line 1046 "scan.l"
 sf_set_skip_ws(1);
        YY_BREAK
 
 
 case 179:
 YY_RULE_SETUP
-#line 947 "scan.l"
+#line 1049 "scan.l"
 BEGIN(SECT2);
        YY_BREAK
 case 180:
 YY_RULE_SETUP
-#line 948 "scan.l"
+#line 1050 "scan.l"
 sf_set_case_ins(0);
        YY_BREAK
 case 181:
 YY_RULE_SETUP
-#line 949 "scan.l"
+#line 1051 "scan.l"
 sf_set_dot_all(0);
        YY_BREAK
 case 182:
 YY_RULE_SETUP
-#line 950 "scan.l"
+#line 1052 "scan.l"
 sf_set_skip_ws(0);
        YY_BREAK
 
@@ -9680,7 +9684,7 @@ case 183:
 (yy_c_buf_p) = yy_cp = yy_bp + 1;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
-#line 954 "scan.l"
+#line 1056 "scan.l"
 BEGIN(CCL); return '^';
        YY_BREAK
 case 184:
@@ -9688,12 +9692,12 @@ case 184:
 (yy_c_buf_p) = yy_cp = yy_bp + 1;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
-#line 955 "scan.l"
+#line 1057 "scan.l"
 return '^';
        YY_BREAK
 case 185:
 YY_RULE_SETUP
-#line 956 "scan.l"
+#line 1058 "scan.l"
 BEGIN(CCL); RETURNCHAR;
        YY_BREAK
 
@@ -9703,23 +9707,23 @@ case 186:
 (yy_c_buf_p) = yy_cp = yy_bp + 1;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
-#line 960 "scan.l"
+#line 1062 "scan.l"
 return '-';
        YY_BREAK
 case 187:
 YY_RULE_SETUP
-#line 961 "scan.l"
+#line 1063 "scan.l"
 RETURNCHAR;
        YY_BREAK
 case 188:
 YY_RULE_SETUP
-#line 962 "scan.l"
+#line 1064 "scan.l"
 BEGIN(SECT2); return ']';
        YY_BREAK
 case 189:
 /* rule 189 can match eol */
 YY_RULE_SETUP
-#line 963 "scan.l"
+#line 1065 "scan.l"
 {
                        synerr( _( "bad character class" ) );
                        BEGIN(SECT2);
@@ -9730,127 +9734,127 @@ YY_RULE_SETUP
 
 case 190:
 YY_RULE_SETUP
-#line 971 "scan.l"
+#line 1073 "scan.l"
 BEGIN(CCL); return CCE_ALNUM;
        YY_BREAK
 case 191:
 YY_RULE_SETUP
-#line 972 "scan.l"
+#line 1074 "scan.l"
 BEGIN(CCL); return CCE_ALPHA;
        YY_BREAK
 case 192:
 YY_RULE_SETUP
-#line 973 "scan.l"
+#line 1075 "scan.l"
 BEGIN(CCL); return CCE_BLANK;
        YY_BREAK
 case 193:
 YY_RULE_SETUP
-#line 974 "scan.l"
+#line 1076 "scan.l"
 BEGIN(CCL); return CCE_CNTRL;
        YY_BREAK
 case 194:
 YY_RULE_SETUP
-#line 975 "scan.l"
+#line 1077 "scan.l"
 BEGIN(CCL); return CCE_DIGIT;
        YY_BREAK
 case 195:
 YY_RULE_SETUP
-#line 976 "scan.l"
+#line 1078 "scan.l"
 BEGIN(CCL); return CCE_GRAPH;
        YY_BREAK
 case 196:
 YY_RULE_SETUP
-#line 977 "scan.l"
+#line 1079 "scan.l"
 BEGIN(CCL); return CCE_LOWER;
        YY_BREAK
 case 197:
 YY_RULE_SETUP
-#line 978 "scan.l"
+#line 1080 "scan.l"
 BEGIN(CCL); return CCE_PRINT;
        YY_BREAK
 case 198:
 YY_RULE_SETUP
-#line 979 "scan.l"
+#line 1081 "scan.l"
 BEGIN(CCL); return CCE_PUNCT;
        YY_BREAK
 case 199:
 YY_RULE_SETUP
-#line 980 "scan.l"
+#line 1082 "scan.l"
 BEGIN(CCL); return CCE_SPACE;
        YY_BREAK
 case 200:
 YY_RULE_SETUP
-#line 981 "scan.l"
+#line 1083 "scan.l"
 BEGIN(CCL); return CCE_UPPER;
        YY_BREAK
 case 201:
 YY_RULE_SETUP
-#line 982 "scan.l"
+#line 1084 "scan.l"
 BEGIN(CCL); return CCE_XDIGIT;
        YY_BREAK
 case 202:
 YY_RULE_SETUP
-#line 984 "scan.l"
+#line 1086 "scan.l"
 BEGIN(CCL); return CCE_NEG_ALNUM;
        YY_BREAK
 case 203:
 YY_RULE_SETUP
-#line 985 "scan.l"
+#line 1087 "scan.l"
 BEGIN(CCL); return CCE_NEG_ALPHA;
        YY_BREAK
 case 204:
 YY_RULE_SETUP
-#line 986 "scan.l"
+#line 1088 "scan.l"
 BEGIN(CCL); return CCE_NEG_BLANK;
        YY_BREAK
 case 205:
 YY_RULE_SETUP
-#line 987 "scan.l"
+#line 1089 "scan.l"
 BEGIN(CCL); return CCE_NEG_CNTRL;
        YY_BREAK
 case 206:
 YY_RULE_SETUP
-#line 988 "scan.l"
+#line 1090 "scan.l"
 BEGIN(CCL); return CCE_NEG_DIGIT;
        YY_BREAK
 case 207:
 YY_RULE_SETUP
-#line 989 "scan.l"
+#line 1091 "scan.l"
 BEGIN(CCL); return CCE_NEG_GRAPH;
        YY_BREAK
 case 208:
 YY_RULE_SETUP
-#line 990 "scan.l"
+#line 1092 "scan.l"
 BEGIN(CCL); return CCE_NEG_LOWER;
        YY_BREAK
 case 209:
 YY_RULE_SETUP
-#line 991 "scan.l"
+#line 1093 "scan.l"
 BEGIN(CCL); return CCE_NEG_PRINT;
        YY_BREAK
 case 210:
 YY_RULE_SETUP
-#line 992 "scan.l"
+#line 1094 "scan.l"
 BEGIN(CCL); return CCE_NEG_PUNCT;
        YY_BREAK
 case 211:
 YY_RULE_SETUP
-#line 993 "scan.l"
+#line 1095 "scan.l"
 BEGIN(CCL); return CCE_NEG_SPACE;
        YY_BREAK
 case 212:
 YY_RULE_SETUP
-#line 994 "scan.l"
+#line 1096 "scan.l"
 BEGIN(CCL); return CCE_NEG_UPPER;
        YY_BREAK
 case 213:
 YY_RULE_SETUP
-#line 995 "scan.l"
+#line 1097 "scan.l"
 BEGIN(CCL); return CCE_NEG_XDIGIT;
        YY_BREAK
 case 214:
 YY_RULE_SETUP
-#line 996 "scan.l"
+#line 1098 "scan.l"
 {
                        format_synerr(
                                _( "bad character class expression: %s" ),
@@ -9862,7 +9866,7 @@ YY_RULE_SETUP
 
 case 215:
 YY_RULE_SETUP
-#line 1005 "scan.l"
+#line 1107 "scan.l"
 {
                        yylval = myctoi( yytext );
                        return NUMBER;
@@ -9870,12 +9874,12 @@ YY_RULE_SETUP
        YY_BREAK
 case 216:
 YY_RULE_SETUP
-#line 1010 "scan.l"
+#line 1112 "scan.l"
 return ',';
        YY_BREAK
 case 217:
 YY_RULE_SETUP
-#line 1011 "scan.l"
+#line 1113 "scan.l"
 {
                        BEGIN(SECT2);
                        if ( lex_compat || posix_compat )
@@ -9886,7 +9890,7 @@ YY_RULE_SETUP
        YY_BREAK
 case 218:
 YY_RULE_SETUP
-#line 1019 "scan.l"
+#line 1121 "scan.l"
 {
                        synerr( _( "bad character inside {}'s" ) );
                        BEGIN(SECT2);
@@ -9896,7 +9900,7 @@ YY_RULE_SETUP
 case 219:
 /* rule 219 can match eol */
 YY_RULE_SETUP
-#line 1025 "scan.l"
+#line 1127 "scan.l"
 {
                        synerr( _( "missing }" ) );
                        BEGIN(SECT2);
@@ -9908,18 +9912,18 @@ YY_RULE_SETUP
 
 case 220:
 YY_RULE_SETUP
-#line 1035 "scan.l"
+#line 1137 "scan.l"
 bracelevel = 0; piece_append("</PLex_Text>");
        YY_BREAK
 case 221:
 YY_RULE_SETUP
-#line 1037 "scan.l"
+#line 1139 "scan.l"
 ACTION_ECHO; yy_push_state( CODE_COMMENT );
        YY_BREAK
 
 case 222:
 YY_RULE_SETUP
-#line 1040 "scan.l"
+#line 1142 "scan.l"
 {
             ACTION_ECHO;
             CHECK_REJECT(yytext);
@@ -9927,7 +9931,7 @@ YY_RULE_SETUP
        YY_BREAK
 case 223:
 YY_RULE_SETUP
-#line 1044 "scan.l"
+#line 1146 "scan.l"
 {
             ACTION_ECHO;
             CHECK_YYMORE(yytext);
@@ -9936,13 +9940,13 @@ YY_RULE_SETUP
 
 case 224:
 YY_RULE_SETUP
-#line 1050 "scan.l"
+#line 1152 "scan.l"
 ACTION_ECHO;
        YY_BREAK
 case 225:
 /* rule 225 can match eol */
 YY_RULE_SETUP
-#line 1051 "scan.l"
+#line 1153 "scan.l"
 {
                ++linenum;
                ACTION_ECHO;
@@ -9965,43 +9969,43 @@ YY_RULE_SETUP
 
 case 226:
 YY_RULE_SETUP
-#line 1072 "scan.l"
+#line 1174 "scan.l"
 ACTION_ECHO; ++bracelevel;
        YY_BREAK
 case 227:
 YY_RULE_SETUP
-#line 1073 "scan.l"
+#line 1175 "scan.l"
 ACTION_ECHO; --bracelevel;
        YY_BREAK
 case 228:
 YY_RULE_SETUP
-#line 1074 "scan.l"
+#line 1176 "scan.l"
 ACTION_ECHO;
        YY_BREAK
 case 229:
 YY_RULE_SETUP
-#line 1075 "scan.l"
+#line 1177 "scan.l"
 ACTION_ECHO;
        YY_BREAK
 case 230:
 YY_RULE_SETUP
-#line 1076 "scan.l"
+#line 1178 "scan.l"
 ACTION_ECHO; /* character constant */
        YY_BREAK
 case 231:
 YY_RULE_SETUP
-#line 1077 "scan.l"
+#line 1179 "scan.l"
 ACTION_ECHO; BEGIN(CHARACTER_CONSTANT);
        YY_BREAK
 case 232:
 YY_RULE_SETUP
-#line 1078 "scan.l"
+#line 1180 "scan.l"
 ACTION_ECHO; BEGIN(ACTION_STRING);
        YY_BREAK
 case 233:
 /* rule 233 can match eol */
 YY_RULE_SETUP
-#line 1079 "scan.l"
+#line 1181 "scan.l"
 {
                 ++linenum;
                 ACTION_ECHO;
@@ -10020,31 +10024,31 @@ YY_RULE_SETUP
        YY_BREAK
 case 234:
 YY_RULE_SETUP
-#line 1094 "scan.l"
+#line 1196 "scan.l"
 ACTION_ECHO;
        YY_BREAK
 
 
 case 235:
 YY_RULE_SETUP
-#line 1098 "scan.l"
+#line 1200 "scan.l"
 ACTION_ECHO;
        YY_BREAK
 case 236:
 YY_RULE_SETUP
-#line 1099 "scan.l"
+#line 1201 "scan.l"
 ACTION_ECHO; BEGIN(ACTION);
        YY_BREAK
 
 
 case 237:
 YY_RULE_SETUP
-#line 1102 "scan.l"
+#line 1204 "scan.l"
 ACTION_ECHO;
        YY_BREAK
 case 238:
 YY_RULE_SETUP
-#line 1103 "scan.l"
+#line 1205 "scan.l"
 ACTION_ECHO; BEGIN(ACTION);
        YY_BREAK
 
@@ -10052,24 +10056,24 @@ ACTION_ECHO; BEGIN(ACTION);
 case 239:
 /* rule 239 can match eol */
 YY_RULE_SETUP
-#line 1106 "scan.l"
+#line 1208 "scan.l"
 ACTION_ECHO;
        YY_BREAK
 case 240:
 /* rule 240 can match eol */
 YY_RULE_SETUP
-#line 1107 "scan.l"
+#line 1209 "scan.l"
 ACTION_ECHO;
        YY_BREAK
 case 241:
 /* rule 241 can match eol */
 YY_RULE_SETUP
-#line 1108 "scan.l"
+#line 1210 "scan.l"
 ++linenum; ACTION_ECHO; if (bracelevel <= 0) { BEGIN(SECT2); flush(); if (doing_rule_action) markup_action("</PLex_Text></PLex_Section2_Rule_Action>"); } else { BEGIN(ACTION); }
        YY_BREAK
 case 242:
 YY_RULE_SETUP
-#line 1109 "scan.l"
+#line 1211 "scan.l"
 ACTION_ECHO;
        YY_BREAK
 
@@ -10079,7 +10083,7 @@ case YY_STATE_EOF(COMMENT_DISCARD):
 case YY_STATE_EOF(ACTION):
 case YY_STATE_EOF(ACTION_STRING):
 case YY_STATE_EOF(CHARACTER_CONSTANT):
-#line 1112 "scan.l"
+#line 1214 "scan.l"
 {
                        synerr( _( "EOF encountered inside an action" ) );
                        yyterminate();
@@ -10088,7 +10092,7 @@ case YY_STATE_EOF(CHARACTER_CONSTANT):
 case YY_STATE_EOF(EXTENDED_COMMENT):
 case YY_STATE_EOF(GROUP_WITH_PARAMS):
 case YY_STATE_EOF(GROUP_MINUS_PARAMS):
-#line 1117 "scan.l"
+#line 1219 "scan.l"
 {
                        synerr( _( "EOF encountered inside pattern" ) );
                        yyterminate();
@@ -10096,7 +10100,7 @@ case YY_STATE_EOF(GROUP_MINUS_PARAMS):
        YY_BREAK
 case 243:
 YY_RULE_SETUP
-#line 1122 "scan.l"
+#line 1224 "scan.l"
 {
                        yylval = myesc( (unsigned char *) yytext );
 
@@ -10109,27 +10113,27 @@ YY_RULE_SETUP
 
 case 244:
 YY_RULE_SETUP
-#line 1132 "scan.l"
+#line 1234 "scan.l"
 fputs(escaped_qstart, yyout);
        YY_BREAK
 case 245:
 YY_RULE_SETUP
-#line 1133 "scan.l"
+#line 1235 "scan.l"
 fputs(escaped_qend, yyout);
        YY_BREAK
 case 246:
 /* rule 246 can match eol */
 YY_RULE_SETUP
-#line 1134 "scan.l"
+#line 1236 "scan.l"
 ECHO;
        YY_BREAK
 case 247:
 YY_RULE_SETUP
-#line 1135 "scan.l"
+#line 1237 "scan.l"
 ECHO;
        YY_BREAK
 case YY_STATE_EOF(SECT3):
-#line 1136 "scan.l"
+#line 1238 "scan.l"
 {
         sectnum = 0;
 #if 1
@@ -10146,27 +10150,27 @@ case YY_STATE_EOF(SECT3):
 
 case 248:
 YY_RULE_SETUP
-#line 1149 "scan.l"
+#line 1251 "scan.l"
 fprintf(yyout, "[""[%s]""]", escaped_qstart);
        YY_BREAK
 case 249:
 YY_RULE_SETUP
-#line 1150 "scan.l"
+#line 1252 "scan.l"
 fprintf(yyout, "[""[%s]""]", escaped_qend);
        YY_BREAK
 case 250:
 /* rule 250 can match eol */
 YY_RULE_SETUP
-#line 1151 "scan.l"
+#line 1253 "scan.l"
 ECHO;
        YY_BREAK
 case 251:
 YY_RULE_SETUP
-#line 1152 "scan.l"
+#line 1254 "scan.l"
 ECHO;
        YY_BREAK
 case YY_STATE_EOF(SECT3_NOESCAPE):
-#line 1153 "scan.l"
+#line 1255 "scan.l"
 {
        sectnum = 0;
 #if 1
@@ -10183,15 +10187,15 @@ case YY_STATE_EOF(SECT3_NOESCAPE):
 case 252:
 /* rule 252 can match eol */
 YY_RULE_SETUP
-#line 1165 "scan.l"
+#line 1267 "scan.l"
 format_synerr( _( "bad character: %s" ), yytext );
        YY_BREAK
 case 253:
 YY_RULE_SETUP
-#line 1167 "scan.l"
+#line 1269 "scan.l"
 YY_FATAL_ERROR( "flex scanner jammed" );
        YY_BREAK
-#line 10083 "scan.c"
+#line 10185 "scan.c"
 case YY_STATE_EOF(INITIAL):
 case YY_STATE_EOF(CODEBLOCK):
 case YY_STATE_EOF(PICKUPDEF):
@@ -11239,7 +11243,7 @@ void yyfree (void * ptr )
 
 #define YYTABLES_NAME "yytables"
 
-#line 1167 "scan.l"
+#line 1269 "scan.l"
 
 
 
index f4dd43c..ee117ca 100644 (file)
@@ -1,35 +1,10 @@
---- scan.c.orig        2018-06-24 10:38:13.780833990 +1000
-+++ scan.c     2018-06-24 10:38:13.796833990 +1000
-@@ -23,6 +23,19 @@
- /* end standard C headers. */
-+char piece_temp[100];
-+char *piece[10000];
-+int piece0;
-+int piece1;
-+void piece_append(const char *str) {
-+ piece[piece1++] = strdup(str);
-+}
-+void piece_insert(int n, const char *str) {
-+ memmove(piece + n + 1, piece + n, (piece1 - n) * sizeof(char *));
-+ piece[n] = strdup(str);
-+ ++piece1;
-+}
-+
- /* flex integer type definitions */
- #ifndef FLEXINT_H
-@@ -185,7 +198,21 @@
+--- scan.c.orig        2018-07-26 11:01:28.498138436 +1000
++++ scan.c     2018-07-26 11:03:23.706134386 +1000
+@@ -185,7 +185,16 @@
                } \
        while ( 0 )
  
 +#if 1
-+#define flush() \
-+ do { \
-+  piece_esc(yytext, yy_c_buf_p - yytext); \
-+  yytext = yy_c_buf_p; \
-+ } while (0)
 +#define unput(c) \
 + do { \
 +  piece_esc(yytext, yy_c_buf_p - yytext); \
  
  #ifndef YY_TYPEDEF_YY_SIZE_T
  #define YY_TYPEDEF_YY_SIZE_T
-@@ -2219,8 +2246,88 @@
- /** The main scanner function which does all the work.
-  */
-+static int real_yylex(void);
-+static void piece_esc(const char *p, size_t n) {
-+ size_t i, j = 0;
-+ for (i = 0; i < n; ++i)
-+  switch (p[i]) {
-+  case '<':
-+  case '>':
-+   j += 4;
-+   break;
-+  case '&':
-+   j += 5;
-+   break;
-+  default:
-+   ++j;
-+   break;
-+  }
-+ char *q = malloc(j + 1);
-+ j = 0;
-+ for (i = 0; i < n; ++i)
-+  switch (p[i]) {
-+  case '<':
-+   memcpy(q + j, "&lt;", 4);
-+   j += 4;
-+   break;
-+  case '>':
-+   memcpy(q + j, "&gt;", 4);
-+   j += 4;
-+   break;
-+  case '&':
-+   memcpy(q + j, "&amp;", 5);
-+   j += 5;
-+   break;
-+  default:
-+   q[j++] = p[i];
-+   break;
-+  }
-+ q[j] = 0;
-+ piece[piece1++] = q;
-+}
-+static void piece_pack() {
-+ int i;
-+ size_t j = 0;
-+ for (i = piece0; i < piece1; ++i)
-+  j += strlen(piece[i]);
-+ char *q = malloc(j + 1);
-+ j = 0;
-+ for (i = piece0; i < piece1; ++i) {
-+  int k = strlen(piece[i]);
-+  memcpy(q + j, piece[i], k);
-+  free(piece[i]);
-+  j += k;
-+ }
-+ q[j] = 0;
-+ piece[piece0++] = q;
-+ piece1 = piece0;
-+}
- YY_DECL
- {
-+ int result = real_yylex();
-+ if (result < 0)
-+  return ~result;
-+ piece_pack();
-+#if 1
-+ piece_esc(yytext, strlen(yytext));
-+#else
-+ size_t n = strlen(yytext);
-+ if (n) {
-+  sprintf(piece_temp, "<token value=\"%d\">", result);
-+  piece_append(piece_temp);
-+  piece_esc(yytext, n);
-+  piece_append("</token>");
-+ }
-+ else {
-+  sprintf(piece_temp, "<token value=\"%d\" />", result);
-+  piece_append(piece_temp);
-+ }
-+#endif
-+ piece_pack();
-+ return result;
-+}
-+static int real_yylex(void)
-+{
-       register yy_state_type yy_current_state;
-       register char *yy_cp, *yy_bp;
-       register int yy_act;
-@@ -2264,7 +2371,12 @@
+@@ -8054,7 +8063,12 @@
                yy_load_buffer_state( );
                }
  
index e96c7ec..557c097 100644 (file)
@@ -130,9 +130,111 @@ extern const char *escaped_qstart, *escaped_qend;
 } while (0)
 
 /* Nick */
+char piece_temp[100];
+char *piece[10000];
+int piece0;
+int piece1;
+void piece_append(const char *str) {
+ piece[piece1++] = strdup(str);
+}
+void piece_insert(int n, const char *str) {
+ memmove(piece + n + 1, piece + n, (piece1 - n) * sizeof(char *));
+ piece[n] = strdup(str);
+ ++piece1;
+}
+
+#define flush() \
+ do { \
+  piece_esc(yytext, yy_c_buf_p - yytext); \
+  yytext = yy_c_buf_p; \
+ } while (0)
+
 static void markup_action(const char *text);
 static void markup_option(const char *name, int sense);
 
+static int real_yylex(void);
+static void piece_esc(const char *p, size_t n) {
+ size_t i, j = 0;
+ for (i = 0; i < n; ++i)
+  switch (p[i]) {
+  case '<':
+  case '>':
+   j += 4;
+   break;
+  case '&':
+   j += 5;
+   break;
+  default:
+   ++j;
+   break;
+  }
+ char *q = malloc(j + 1);
+ j = 0;
+ for (i = 0; i < n; ++i)
+  switch (p[i]) {
+  case '<':
+   memcpy(q + j, "&lt;", 4);
+   j += 4;
+   break;
+  case '>':
+   memcpy(q + j, "&gt;", 4);
+   j += 4;
+   break;
+  case '&':
+   memcpy(q + j, "&amp;", 5);
+   j += 5;
+   break;
+  default:
+   q[j++] = p[i];
+   break;
+  }
+ q[j] = 0;
+ piece[piece1++] = q;
+}
+static void piece_pack() {
+ int i;
+ size_t j = 0;
+ for (i = piece0; i < piece1; ++i)
+  j += strlen(piece[i]);
+ char *q = malloc(j + 1);
+ j = 0;
+ for (i = piece0; i < piece1; ++i) {
+  int k = strlen(piece[i]);
+  memcpy(q + j, piece[i], k);
+  free(piece[i]);
+  j += k;
+ }
+ q[j] = 0;
+ piece[piece0++] = q;
+ piece1 = piece0;
+}
+YY_DECL
+{
+ int result = real_yylex();
+ if (result < 0)
+  return ~result;
+ piece_pack();
+#if 1
+ piece_esc(yytext, strlen(yytext));
+#else
+ size_t n = strlen(yytext);
+ if (n) {
+  sprintf(piece_temp, "<token value=\"%d\">", result);
+  piece_append(piece_temp);
+  piece_esc(yytext, n);
+  piece_append("</token>");
+ }
+ else {
+  sprintf(piece_temp, "<token value=\"%d\" />", result);
+  piece_append(piece_temp);
+ }
+#endif
+ piece_pack();
+ return result;
+}
+#undef YY_DECL
+#define YY_DECL static int real_yylex(void)
+
 %}
 
 %option caseless nodefault noreject stack noyy_top_state
index 53752db..8ab5a64 100644 (file)
@@ -1,35 +1,10 @@
---- stage1scan.c.orig  2018-06-24 10:38:18.196833803 +1000
-+++ stage1scan.c       2018-06-24 10:38:18.216833803 +1000
-@@ -24,6 +24,19 @@
- /* end standard C headers. */
-+char piece_temp[100];
-+char *piece[10000];
-+int piece0;
-+int piece1;
-+void piece_append(const char *str) {
-+ piece[piece1++] = strdup(str);
-+}
-+void piece_insert(int n, const char *str) {
-+ memmove(piece + n + 1, piece + n, (piece1 - n) * sizeof(char *));
-+ piece[n] = strdup(str);
-+ ++piece1;
-+}
-+
- /* flex integer type definitions */
- #ifndef FLEXINT_H
-@@ -179,7 +192,21 @@
+--- stage1scan.c.orig  2018-07-26 11:01:32.222138305 +1000
++++ stage1scan.c       2018-07-26 11:01:54.830137510 +1000
+@@ -179,7 +179,16 @@
                YY_DO_BEFORE_ACTION; /* set up yytext again */ \
                } \
        while ( 0 )
 +#if 1
-+#define flush() \
-+ do { \
-+  piece_esc(yytext, yy_c_buf_p - yytext); \
-+  yytext = yy_c_buf_p; \
-+ } while (0)
 +#define unput(c) \
 + do { \
 +  piece_esc(yytext, yy_c_buf_p - yytext); \
  
  #ifndef YY_STRUCT_YY_BUFFER_STATE
  #define YY_STRUCT_YY_BUFFER_STATE
-@@ -2196,8 +2223,88 @@
- /** The main scanner function which does all the work.
-  */
-+static int real_yylex(void);
-+static void piece_esc(const char *p, size_t n) {
-+ size_t i, j = 0;
-+ for (i = 0; i < n; ++i)
-+  switch (p[i]) {
-+  case '<':
-+  case '>':
-+   j += 4;
-+   break;
-+  case '&':
-+   j += 5;
-+   break;
-+  default:
-+   ++j;
-+   break;
-+  }
-+ char *q = malloc(j + 1);
-+ j = 0;
-+ for (i = 0; i < n; ++i)
-+  switch (p[i]) {
-+  case '<':
-+   memcpy(q + j, "&lt;", 4);
-+   j += 4;
-+   break;
-+  case '>':
-+   memcpy(q + j, "&gt;", 4);
-+   j += 4;
-+   break;
-+  case '&':
-+   memcpy(q + j, "&amp;", 5);
-+   j += 5;
-+   break;
-+  default:
-+   q[j++] = p[i];
-+   break;
-+  }
-+ q[j] = 0;
-+ piece[piece1++] = q;
-+}
-+static void piece_pack() {
-+ int i;
-+ size_t j = 0;
-+ for (i = piece0; i < piece1; ++i)
-+  j += strlen(piece[i]);
-+ char *q = malloc(j + 1);
-+ j = 0;
-+ for (i = piece0; i < piece1; ++i) {
-+  int k = strlen(piece[i]);
-+  memcpy(q + j, piece[i], k);
-+  free(piece[i]);
-+  j += k;
-+ }
-+ q[j] = 0;
-+ piece[piece0++] = q;
-+ piece1 = piece0;
-+}
- YY_DECL
- {
-+ int result = real_yylex();
-+ if (result < 0)
-+  return ~result;
-+ piece_pack();
-+#if 1
-+ piece_esc(yytext, strlen(yytext));
-+#else
-+ size_t n = strlen(yytext);
-+ if (n) {
-+  sprintf(piece_temp, "<token value=\"%d\">", result);
-+  piece_append(piece_temp);
-+  piece_esc(yytext, n);
-+  piece_append("</token>");
-+ }
-+ else {
-+  sprintf(piece_temp, "<token value=\"%d\" />", result);
-+  piece_append(piece_temp);
-+ }
-+#endif
-+ piece_pack();
-+ return result;
-+}
-+static int real_yylex(void)
-+{
-       yy_state_type yy_current_state;
-       char *yy_cp, *yy_bp;
-       int yy_act;
-@@ -2243,7 +2350,12 @@
+@@ -7928,7 +8017,12 @@
  
- #line 2244 "stage1scan.c"
+ #line 7929 "stage1scan.c"
  
 +#if 1
 + /* we do this so that "continue;" in an action works correctly */