@@ -484,17 +484,6 @@ fsm_print_c_body(FILE *f, const struct ir *ir,
484
484
}
485
485
}
486
486
487
- /* This flag indicates whether the any of the input stream was
488
- * consumed before getting EOF and skipping over the state and
489
- * character logic expanded here.
490
- *
491
- * lx needs to track this for proper EOF handling. It previously
492
- * generated the state enum itself, so that it could include an
493
- * additional 'NONE' state. Inside the input loop, the default
494
- * state of NONE would be updated to the start state, but if the
495
- * input loop was skipped it would still be NONE. */
496
- fprintf (f , "\tint has_consumed_input = 0;\n" );
497
-
498
487
/* enum of states */
499
488
print_stateenum (f , ir -> n );
500
489
fprintf (f , "\n" );
@@ -506,17 +495,14 @@ fsm_print_c_body(FILE *f, const struct ir *ir,
506
495
switch (opt -> io ) {
507
496
case FSM_IO_GETC :
508
497
fprintf (f , "\twhile (c = fsm_getc(getc_opaque), c != EOF) {\n" );
509
- fprintf (f , "\t\thas_consumed_input = 1;\n" );
510
498
break ;
511
499
512
500
case FSM_IO_STR :
513
501
fprintf (f , "\tfor (p = s; *p != '\\0'; p++) {\n" );
514
- fprintf (f , "\t\thas_consumed_input = 1;\n" );
515
502
break ;
516
503
517
504
case FSM_IO_PAIR :
518
505
fprintf (f , "\tfor (p = b; p != e; p++) {\n" );
519
- fprintf (f , "\t\thas_consumed_input = 1;\n" );
520
506
break ;
521
507
}
522
508
@@ -533,10 +519,6 @@ fsm_print_c_body(FILE *f, const struct ir *ir,
533
519
fprintf (f , "\t}\n" );
534
520
fprintf (f , "\n" );
535
521
536
- /* Suppress unused variable warning -- this is mainly for lx. */
537
- fprintf (f , "\t(void)has_consumed_input;\n" );
538
- fprintf (f , "\n" );
539
-
540
522
/* end states */
541
523
if (-1 == print_endstates (f , opt , hooks , ir )) {
542
524
return -1 ;
0 commit comments