diff options
author | Vern Paxson <vern@ee.lbl.gov> | 1993-08-24 20:43:03 +0000 |
---|---|---|
committer | Vern Paxson <vern@ee.lbl.gov> | 1993-08-24 20:43:03 +0000 |
commit | eb4bc1e0cf3d9d7c8b8802bcac8909fb26758b2d (patch) | |
tree | 9512cee9c14830f6dbbebee71b39339b4bbc974e /scan.l | |
parent | 2b84ab9e5489f4df70d67c2a3b9fe6dfa433ed75 (diff) |
Fixed bug with empty section 2
Diffstat (limited to 'scan.l')
-rw-r--r-- | scan.l | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -213,7 +213,12 @@ CCL_CHAR [^\\\n\]]|{ESCSEQ} <SECT2PROLOG>.*{NL} ++linenum; ACTION_ECHO; -<SECT2PROLOG><<EOF>> MARK_END_OF_PROLOG; yyterminate(); +<SECT2PROLOG><<EOF>> { + MARK_END_OF_PROLOG; + sectnum = 3; + BEGIN(SECT3); + yyterminate(); /* to stop the parser */ + } <SECT2>^{OPTWS}{NL} ++linenum; /* allow blank lines in section 2 */ @@ -266,7 +271,7 @@ CCL_CHAR [^\\\n\]]|{ESCSEQ} <SECT2>^"%%".* { sectnum = 3; BEGIN(SECT3); - return EOF; /* to stop the parser */ + yyterminate(); /* to stop the parser */ } <SECT2>"["{FIRST_CCL_CHAR}{CCL_CHAR}* { @@ -485,6 +490,7 @@ CCL_CHAR [^\\\n\]]|{ESCSEQ} <SECT3>.*(\n?) ECHO; +<SECT3><<EOF>> sectnum = 0; yyterminate(); <*>.|\n format_synerr( "bad character: %s", (char *) yytext ); |