From bb038e86a2a60bccbe4932c9e88d8f302d61579a Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Wed, 4 Jun 2008 15:39:44 +0000 Subject: [PATCH] Preproc: Fix error when macro call has commas in concatenate. git-svn-id: file://localhost/svn/verilator/trunk/verilator@1071 77ca24e4-aefa-0310-84f0-b9a241c72d87 --- Changes | 2 ++ src/V3PreLex.l | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index 3da45a90b..f47363b41 100644 --- a/Changes +++ b/Changes @@ -7,6 +7,8 @@ indicates the contributor was also the author of the fix; Thanks! **** Fix syntax error when "`include `defname" is ifdefed. [John Dickol] +**** Fix error when macro call has commas in concatenate. [John Dickol] + **** Fix compile errors under Fedora 9, GCC 4.3.0. [by Jeremy Bennett] * Verilator 3.664 2008/05/08 diff --git a/src/V3PreLex.l b/src/V3PreLex.l index 7cec09e4a..acc0b18cd 100644 --- a/src/V3PreLex.l +++ b/src/V3PreLex.l @@ -141,6 +141,10 @@ psl [p]sl <> { yyerrorf("EOF in define argument list\n"); yyleng = 0; yyterminate(); } {crnl} { linenoInc(); yytext=(char*)"\n"; yyleng=1; return(VP_WHITE); } {quote} { yy_push_state(STRMODE); yymore(); } +[{\[] { V3PreLex::s_currentLexp->m_parenLevel++; + appendDefValue(yytext,yyleng); } +[}\]] { V3PreLex::s_currentLexp->m_parenLevel--; + appendDefValue(yytext,yyleng); } [(] { V3PreLex::s_currentLexp->m_parenLevel++; // Note paren level 0 means before "(" of starting args // Level 1 means "," between arguments @@ -162,7 +166,7 @@ psl [p]sl yy_pop_state(); return (VP_DEFARG); }} "`"{symb} { return (VP_DEFREF); } /* defref in defref */ -[^\/\*\n\r\\(,)\"`]+ | +[^\/\*\n\r\\(,){}\[\]\"`]+ | . { appendDefValue(yytext,yyleng); } /* One line comments. */