mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-08-22 05:47:31 +02:00
Increment line number when parsing "// synthesis" pragmas (issue #1242)
Thanks to Robert Lance for proposing the fix.
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
%{
|
%{
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998-2024 Stephen Williams ([email protected])
|
* Copyright (c) 1998-2025 Stephen Williams ([email protected])
|
||||||
*
|
*
|
||||||
* This source code is free software; you can redistribute it
|
* This source code is free software; you can redistribute it
|
||||||
* and/or modify it in source code form under the terms of the GNU
|
* and/or modify it in source code form under the terms of the GNU
|
||||||
@@ -184,8 +184,8 @@ TU [munpf]
|
|||||||
"always" statements. */
|
"always" statements. */
|
||||||
|
|
||||||
"// Icarus preprocessor had ("[0-9]+") errors."\n { pre_process_failed(yytext); }
|
"// Icarus preprocessor had ("[0-9]+") errors."\n { pre_process_failed(yytext); }
|
||||||
"//"{W}*"synthesis"{W}+"translate_on"{W}*\n { pform_mc_translate_on(true); }
|
"//"{W}*"synthesis"{W}+"translate_on"{W}*\n { pform_mc_translate_on(true); yylloc.first_line += 1; }
|
||||||
"//"{W}*"synthesis"{W}+"translate_off"{W}*\n { pform_mc_translate_on(false); }
|
"//"{W}*"synthesis"{W}+"translate_off"{W}*\n { pform_mc_translate_on(false); yylloc.first_line += 1; }
|
||||||
"//" { comment_enter = YY_START; BEGIN(LCOMMENT); }
|
"//" { comment_enter = YY_START; BEGIN(LCOMMENT); }
|
||||||
<LCOMMENT>. { yymore(); }
|
<LCOMMENT>. { yymore(); }
|
||||||
<LCOMMENT>\n { yylloc.first_line += 1; BEGIN(comment_enter); }
|
<LCOMMENT>\n { yylloc.first_line += 1; BEGIN(comment_enter); }
|
||||||
|
|||||||
Reference in New Issue
Block a user