From 9ca3dbc14098828972a690efc6b6446b7928806d Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Tue, 15 Apr 2008 19:12:25 +0000 Subject: [PATCH] Allow defines terminated in EOF, though against spec. [Stefan Thiede] git-svn-id: file://localhost/svn/verilator/trunk/verilator@1029 77ca24e4-aefa-0310-84f0-b9a241c72d87 --- Changes | 2 ++ src/V3PreLex.l | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index 421129339..877a19082 100644 --- a/Changes +++ b/Changes @@ -7,6 +7,8 @@ indicates the contributor was also the author of the fix; Thanks! **** Add error message when modules have duplicate names. [Stefan Thiede] +**** Allow defines terminated in EOF, though against spec. [Stefan Thiede] + **** Fix "always @ ((a) or (b))" syntax error. [by Niranjan Prabhu] **** Fix "output reg name=expr;" syntax error. [Martin Scharrer] diff --git a/src/V3PreLex.l b/src/V3PreLex.l index 3fd0953c3..c6edff507 100644 --- a/src/V3PreLex.l +++ b/src/V3PreLex.l @@ -126,7 +126,7 @@ psl [p]sl "/*" { yy_push_state(CMTMODE); yymore(); } "//"[^\n\r]* { return (VP_COMMENT);} {drop} { } -<> { linenoInc(); yyerror("EOF (missing return?) in define value"); yyleng=0; yyterminate(); } +<> { linenoInc(); yy_pop_state(); yytext="\n"; yyleng=1; return (VP_DEFVALUE); } /* Technically illegal, but people complained */ {crnl} { linenoInc(); yy_pop_state(); yytext="\n"; yyleng=1; return (VP_DEFVALUE); } [\\]{crnl} { linenoInc(); appendDefValue("\n",1); } /* Include return so can maintain output line count */ [^\/\*\n\r\\]+ |