diff options
author | Alberto Gonzalez <boqwxp@airmail.cc> | 2020-05-06 07:22:17 +0000 |
---|---|---|
committer | Alberto Gonzalez <boqwxp@airmail.cc> | 2020-05-06 07:22:17 +0000 |
commit | 323aa1df75dcc21e94c4dfbdb77eaad40f48d081 (patch) | |
tree | 1856c36e587947f757f0c0efeac023c18a4c0206 /frontends | |
parent | 283b1130a651324ff870059dc3b1cf869948db93 (diff) | |
download | yosys-323aa1df75dcc21e94c4dfbdb77eaad40f48d081.tar.gz yosys-323aa1df75dcc21e94c4dfbdb77eaad40f48d081.tar.bz2 yosys-323aa1df75dcc21e94c4dfbdb77eaad40f48d081.zip |
verilog: Move lexer location variables from global namespace to `VERILOG_FRONTEND` namespace.
Diffstat (limited to 'frontends')
-rw-r--r-- | frontends/verilog/verilog_lexer.l | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/frontends/verilog/verilog_lexer.l b/frontends/verilog/verilog_lexer.l index f6a3ac4db..63c0ba159 100644 --- a/frontends/verilog/verilog_lexer.l +++ b/frontends/verilog/verilog_lexer.l @@ -48,16 +48,18 @@ USING_YOSYS_NAMESPACE using namespace AST; using namespace VERILOG_FRONTEND; +#define YYSTYPE FRONTEND_VERILOG_YYSTYPE +#define YYLTYPE FRONTEND_VERILOG_YYLTYPE + YOSYS_NAMESPACE_BEGIN namespace VERILOG_FRONTEND { std::vector<std::string> fn_stack; std::vector<int> ln_stack; + YYLTYPE real_location; + YYLTYPE old_location; } YOSYS_NAMESPACE_END -#define YYSTYPE FRONTEND_VERILOG_YYSTYPE -#define YYLTYPE FRONTEND_VERILOG_YYLTYPE - #define SV_KEYWORD(_tok) \ if (sv_mode) return _tok; \ log("Lexer warning: The SystemVerilog keyword `%s' (at %s:%d) is not "\ @@ -73,9 +75,6 @@ YOSYS_NAMESPACE_END #define YY_INPUT(buf,result,max_size) \ result = readsome(*VERILOG_FRONTEND::lexin, buf, max_size) -YYLTYPE real_location; -YYLTYPE old_location; - #define YY_USER_ACTION \ old_location = real_location; \ real_location.first_line = real_location.last_line; \ |