diff --git a/modules/src/em_opt/parser.g b/modules/src/em_opt/parser.g index 4f5220482..bb81999c7 100644 --- a/modules/src/em_opt/parser.g +++ b/modules/src/em_opt/parser.g @@ -487,7 +487,7 @@ LLmessage(insertedtok) fprintf(stderr,"parser: syntax error on line %d: ",linenum); if(insertedtok) { fprintf(stderr,"Inserted token %d\n",insertedtok); - yyless(0); + back_token(); } else fprintf(stderr,"Deleted token %d\n",LLsymb); } diff --git a/modules/src/em_opt/syntax.l b/modules/src/em_opt/syntax.l index 7cb7dda7b..510ca2661 100644 --- a/modules/src/em_opt/syntax.l +++ b/modules/src/em_opt/syntax.l @@ -58,3 +58,8 @@ offset return(OFFSET); \n { linenum++; return(yytext[0]);} . return(yytext[0]); %% + +back_token() +{ + yyless(0); +}