From e00e4d4245c5622102fb8fa88b78c66312dbb2ea Mon Sep 17 00:00:00 2001 From: Paul Swirhun <63216497+paul-demo@users.noreply.github.com> Date: Thu, 22 Feb 2024 00:29:57 -0800 Subject: [PATCH] Fix whitespace in `pragma protect version` (#4914) --- src/V3PreLex.l | 2 +- test_regress/t/t_lint_pragma_protected.v | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/V3PreLex.l b/src/V3PreLex.l index 429d1c3cc..63e5989c2 100644 --- a/src/V3PreLex.l +++ b/src/V3PreLex.l @@ -160,7 +160,7 @@ bom [\357\273\277] BEGIN(ENCBASE64); return VP_TEXT; } ("begin_protected"|"end_protected"|"end")[\n\r] { FL_FWDC; linenoInc(); BEGIN(INITIAL); return VP_TEXT; } -"version="[^\n\r]*[\n\r] { +"version"{wsn}*={wsn}*[^\n\r]*[\n\r] { FL_FWDC; linenoInc(); BEGIN(INITIAL); diff --git a/test_regress/t/t_lint_pragma_protected.v b/test_regress/t/t_lint_pragma_protected.v index 3852391fc..5525477b2 100644 --- a/test_regress/t/t_lint_pragma_protected.v +++ b/test_regress/t/t_lint_pragma_protected.v @@ -9,7 +9,11 @@ module t_lint_pragma_protected; `pragma protect begin_protected +// Any amount of whitespace should be ok `pragma protect version=1 +`pragma protect version = 1 +`pragma protect version= 1 +`pragma protect version =1 `pragma protect encrypt_agent="XXXXX" `pragma protect encrypt_agent_info="YYYYY" `pragma protect data_method="AES128-CBC"