diff options
author | David Shah <dave@ds0.me> | 2020-04-01 20:55:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-01 20:55:24 +0100 |
commit | f3405e7c7990f7ce1dc23d7a464c9a30e641126c (patch) | |
tree | f694e1128ec6d9d8f31102054a3d65364a5769c7 /frontends | |
parent | d8dd842c09cca463425e1b5d25f18df6b255d1be (diff) | |
parent | c3997c77a571ec4373aaeb1d263d2dacabf1c028 (diff) | |
download | yosys-f3405e7c7990f7ce1dc23d7a464c9a30e641126c.tar.gz yosys-f3405e7c7990f7ce1dc23d7a464c9a30e641126c.tar.bz2 yosys-f3405e7c7990f7ce1dc23d7a464c9a30e641126c.zip |
Merge pull request #1844 from YosysHQ/dave/gen-source-loc
verilog: Add location info for generate constructs
Diffstat (limited to 'frontends')
-rw-r--r-- | frontends/verilog/verilog_parser.y | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/frontends/verilog/verilog_parser.y b/frontends/verilog/verilog_parser.y index be2872e59..3f28f828d 100644 --- a/frontends/verilog/verilog_parser.y +++ b/frontends/verilog/verilog_parser.y @@ -2522,6 +2522,7 @@ gen_stmt: } simple_behavioral_stmt ';' expr { ast_stack.back()->children.push_back($6); } ';' simple_behavioral_stmt ')' gen_stmt_block { + SET_AST_NODE_LOC(ast_stack.back(), @1, @11); ast_stack.pop_back(); } | TOK_IF '(' expr ')' { @@ -2530,6 +2531,7 @@ gen_stmt: ast_stack.push_back(node); ast_stack.back()->children.push_back($3); } gen_stmt_block opt_gen_else { + SET_AST_NODE_LOC(ast_stack.back(), @1, @7); ast_stack.pop_back(); } | case_type '(' expr ')' { @@ -2538,6 +2540,7 @@ gen_stmt: ast_stack.push_back(node); } gen_case_body TOK_ENDCASE { case_type_stack.pop_back(); + SET_AST_NODE_LOC(ast_stack.back(), @1, @7); ast_stack.pop_back(); } | TOK_BEGIN { @@ -2551,6 +2554,7 @@ gen_stmt: exitTypeScope(); delete $3; delete $7; + SET_AST_NODE_LOC(ast_stack.back(), @1, @7); ast_stack.pop_back(); } | TOK_MSG_TASKS { @@ -2560,6 +2564,7 @@ gen_stmt: ast_stack.back()->children.push_back(node); ast_stack.push_back(node); } opt_arg_list ';'{ + SET_AST_NODE_LOC(ast_stack.back(), @1, @3); ast_stack.pop_back(); }; @@ -2569,6 +2574,7 @@ gen_stmt_block: ast_stack.back()->children.push_back(node); ast_stack.push_back(node); } gen_stmt_or_module_body_stmt { + SET_AST_NODE_LOC(ast_stack.back(), @2, @2); ast_stack.pop_back(); }; |