aboutsummaryrefslogtreecommitdiffstats
path: root/frontends/verilog/verilog_lexer.l
diff options
context:
space:
mode:
authorwhitequark <whitequark@whitequark.org>2020-05-29 06:46:33 +0000
committerGitHub <noreply@github.com>2020-05-29 06:46:33 +0000
commit2116d9500c6abc1b52871b7f7e429b177f8d6bed (patch)
tree7fa58c27409472ced39b9406e892d552eb939a50 /frontends/verilog/verilog_lexer.l
parent0d99522b3c2ca2502129110e09f9988874e37abc (diff)
parent323aa1df75dcc21e94c4dfbdb77eaad40f48d081 (diff)
downloadyosys-2116d9500c6abc1b52871b7f7e429b177f8d6bed.tar.gz
yosys-2116d9500c6abc1b52871b7f7e429b177f8d6bed.tar.bz2
yosys-2116d9500c6abc1b52871b7f7e429b177f8d6bed.zip
Merge pull request #2033 from boqwxp/cleanup-verilog-lexer
verilog: Move lexer location variables from global namespace to `VERILOG_FRONTEND` namespace.
Diffstat (limited to 'frontends/verilog/verilog_lexer.l')
-rw-r--r--frontends/verilog/verilog_lexer.l11
1 files changed, 5 insertions, 6 deletions
diff --git a/frontends/verilog/verilog_lexer.l b/frontends/verilog/verilog_lexer.l
index 65a2e9a78..02fa0031b 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; \