From 2b01cf335cc4cc8569a5ff17f46340f8b07bdb85 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Sun, 11 May 2025 11:38:28 +0100 Subject: [PATCH] Increment line number when parsing "// synthesis" pragmas (issue #1242) Thanks to Robert Lance for proposing the fix. --- lexor.lex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lexor.lex b/lexor.lex index 5a77684f3..ef291f9d6 100644 --- a/lexor.lex +++ b/lexor.lex @@ -4,7 +4,7 @@ %{ /* - * Copyright (c) 1998-2024 Stephen Williams (steve@icarus.com) + * Copyright (c) 1998-2025 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -184,8 +184,8 @@ TU [munpf] "always" statements. */ "// 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_off"{W}*\n { pform_mc_translate_on(false); } +"//"{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); yylloc.first_line += 1; } "//" { comment_enter = YY_START; BEGIN(LCOMMENT); } . { yymore(); } \n { yylloc.first_line += 1; BEGIN(comment_enter); }