diff --git a/src/xspice/cmpp/ifs_lex.l b/src/xspice/cmpp/ifs_lex.l index 8a96365e9..2d1df697d 100755 --- a/src/xspice/cmpp/ifs_lex.l +++ b/src/xspice/cmpp/ifs_lex.l @@ -86,7 +86,9 @@ E [eE][+-]?{D}+ \n /* new line */ -<> {ifs_yyerror ("Unterminated comment"); yyterminate(); } +<> {ifs_yyerror ("Unterminated comment"); + BEGIN(INITIAL); + yyterminate(); } "*"+"/" { BEGIN(INITIAL); } @@ -96,8 +98,9 @@ E [eE][+-]?{D}+ "\"" { BEGIN(INITIAL); } -<> {ifs_yyerror ("Unterminated string literal"); - yyterminate(); } +<> {ifs_yyerror ("Unterminated string literal"); + BEGIN(INITIAL); + yyterminate(); } allowed_types{W}*: {BEGIN CTYPE; return TOK_ALLOWED_TYPES;} vector{W}*: {BEGIN BOOL; return TOK_ARRAY;}