diff options
author | Alberto Gonzalez <boqwxp@airmail.cc> | 2020-04-10 22:37:36 +0000 |
---|---|---|
committer | Alberto Gonzalez <boqwxp@airmail.cc> | 2020-04-16 19:11:47 +0000 |
commit | 92534973588d2baa42b6078f3540ba736f3d802a (patch) | |
tree | 18567b54dcd44a00bca3dbcecbdba1f34f17fa63 /frontends | |
parent | 8d3f6d0d792a1cd688ce4d9c05bef8ec601f9334 (diff) | |
download | yosys-92534973588d2baa42b6078f3540ba736f3d802a.tar.gz yosys-92534973588d2baa42b6078f3540ba736f3d802a.tar.bz2 yosys-92534973588d2baa42b6078f3540ba736f3d802a.zip |
Add location information to `AST_CONSTANT` nodes.
Diffstat (limited to 'frontends')
-rw-r--r-- | frontends/verilog/verilog_parser.y | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/frontends/verilog/verilog_parser.y b/frontends/verilog/verilog_parser.y index 76373c2e4..7447ab8d5 100644 --- a/frontends/verilog/verilog_parser.y +++ b/frontends/verilog/verilog_parser.y @@ -2618,6 +2618,7 @@ basic_expr: bits->str = *$1; SET_AST_NODE_LOC(bits, @1, @1); AstNode *val = const2ast(*$2, case_type_stack.size() == 0 ? 0 : case_type_stack.back(), !lib_mode); + SET_AST_NODE_LOC(val, @2, @2); if (val == NULL) log_error("Value conversion failed: `%s'\n", $2->c_str()); $$ = new AstNode(AST_TO_BITS, bits, val); @@ -2626,6 +2627,7 @@ basic_expr: } | integral_number { $$ = const2ast(*$1, case_type_stack.size() == 0 ? 0 : case_type_stack.back(), !lib_mode); + SET_AST_NODE_LOC($$, @1, @1); if ($$ == NULL) log_error("Value conversion failed: `%s'\n", $1->c_str()); delete $1; @@ -2644,6 +2646,7 @@ basic_expr: } | TOK_STRING { $$ = AstNode::mkconst_str(*$1); + SET_AST_NODE_LOC($$, @1, @1); delete $1; } | hierarchical_id attr { |