From: Vern Paxson Date: Tue, 24 Aug 1993 20:43:03 +0000 (+0000) Subject: Fixed bug with empty section 2 X-Git-Tag: flex-2-5-5b~423 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eb4bc1e0cf3d9d7c8b8802bcac8909fb26758b2d;p=flex Fixed bug with empty section 2 --- diff --git a/scan.l b/scan.l index fb2f465..9f0e8ca 100644 --- a/scan.l +++ b/scan.l @@ -213,7 +213,12 @@ CCL_CHAR [^\\\n\]]|{ESCSEQ} .*{NL} ++linenum; ACTION_ECHO; -<> MARK_END_OF_PROLOG; yyterminate(); +<> { + MARK_END_OF_PROLOG; + sectnum = 3; + BEGIN(SECT3); + yyterminate(); /* to stop the parser */ + } ^{OPTWS}{NL} ++linenum; /* allow blank lines in section 2 */ @@ -266,7 +271,7 @@ CCL_CHAR [^\\\n\]]|{ESCSEQ} ^"%%".* { sectnum = 3; BEGIN(SECT3); - return EOF; /* to stop the parser */ + yyterminate(); /* to stop the parser */ } "["{FIRST_CCL_CHAR}{CCL_CHAR}* { @@ -485,6 +490,7 @@ CCL_CHAR [^\\\n\]]|{ESCSEQ} .*(\n?) ECHO; +<> sectnum = 0; yyterminate(); <*>.|\n format_synerr( "bad character: %s", (char *) yytext );