Skip to content

Commit 30dfb5f

Browse files
authored
Merge pull request #1265 from diffblue/verilog-parser-push-scope
Verilog parser: scope names are always base names
2 parents 132734e + 1c6a185 commit 30dfb5f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/verilog/parser.y

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Author: Daniel Kroening, [email protected]
3131
#define mts(x, y) stack_expr(x).move_to_sub((irept &)stack_expr(y))
3232
#define swapop(x, y) stack_expr(x).operands().swap(stack_expr(y).operands())
3333
#define addswap(x, y, z) stack_expr(x).add(y).swap(stack_expr(z))
34-
#define push_scope(name, separator, kind) PARSER.scopes.push_scope(name, separator, kind)
34+
#define push_scope(base_name, separator, kind) PARSER.scopes.push_scope(base_name, separator, kind)
3535
#define pop_scope() PARSER.scopes.pop_scope();
3636

3737
int yyveriloglex();
@@ -1457,7 +1457,7 @@ type_declaration:
14571457
data_type any_identifier ';'
14581458
{ $$ = $2;
14591459
// add to the scope as a type name
1460-
PARSER.scopes.add_name(stack_expr($4).get(ID_identifier), "", verilog_scopet::TYPEDEF);
1460+
PARSER.scopes.add_name(stack_expr($4).get(ID_base_name), "", verilog_scopet::TYPEDEF);
14611461
addswap($$, ID_type, $3);
14621462
stack_expr($4).id(ID_declarator);
14631463
mto($$, $4);
@@ -2162,7 +2162,7 @@ function_declaration: TOK_FUNCTION lifetime_opt function_body_declaration
21622162
function_body_declaration:
21632163
function_data_type_or_implicit
21642164
function_identifier
2165-
{ push_scope(stack_expr($2).get(ID_identifier), ".", verilog_scopet::FUNCTION); }
2165+
{ push_scope(stack_expr($2).get(ID_base_name), ".", verilog_scopet::FUNCTION); }
21662166
';'
21672167
tf_item_declaration_brace statement
21682168
TOK_ENDFUNCTION
@@ -2176,7 +2176,7 @@ function_body_declaration:
21762176
}
21772177
| function_data_type_or_implicit
21782178
function_identifier
2179-
{ push_scope(stack_expr($2).get(ID_identifier), ".", verilog_scopet::FUNCTION); }
2179+
{ push_scope(stack_expr($2).get(ID_base_name), ".", verilog_scopet::FUNCTION); }
21802180
'(' tf_port_list_opt ')' ';'
21812181
tf_item_declaration_brace statement
21822182
TOK_ENDFUNCTION
@@ -2216,7 +2216,7 @@ function_prototype: TOK_FUNCTION data_type_or_void function_identifier
22162216

22172217
task_declaration:
22182218
TOK_TASK task_identifier
2219-
{ push_scope(stack_expr($2).get(ID_identifier), ".", verilog_scopet::TASK); }
2219+
{ push_scope(stack_expr($2).get(ID_base_name), ".", verilog_scopet::TASK); }
22202220
';'
22212221
tf_item_declaration_brace
22222222
statement_or_null TOK_ENDTASK
@@ -2227,7 +2227,7 @@ task_declaration:
22272227
pop_scope();
22282228
}
22292229
| TOK_TASK task_identifier
2230-
{ push_scope(stack_expr($2).get(ID_identifier), ".", verilog_scopet::TASK); }
2230+
{ push_scope(stack_expr($2).get(ID_base_name), ".", verilog_scopet::TASK); }
22312231
'(' tf_port_list_opt ')' ';'
22322232
tf_item_declaration_brace
22332233
statement_or_null TOK_ENDTASK

0 commit comments

Comments
 (0)