Skip to content

Commit 9598506

Browse files
committed
Verilog: allow task invocations without parentheses
1 parent d4845d1 commit 9598506

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
KNOWNBUG
1+
CORE
22
task_invocation1.sv
33

44
^EXIT=0$
55
^SIGNAL=0$
66
--
77
^warning: ignoring
88
--
9-
The parser rejects invocations without ().

src/verilog/parser.y

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4007,7 +4007,7 @@ unsigned_number: TOK_NUMBER
40074007
// A.8.2 Subroutine calls
40084008

40094009
tf_call:
4010-
hierarchical_tf_identifier list_of_arguments_paren
4010+
hierarchical_identifier list_of_arguments_paren_opt
40114011
{ init($$, ID_function_call);
40124012
stack_expr($$).operands().reserve(2);
40134013
mto($$, $1); mto($$, $2); }
@@ -4020,6 +4020,7 @@ list_of_arguments_paren:
40204020

40214021
list_of_arguments_paren_opt:
40224022
/* Optional */
4023+
{ init($$); }
40234024
| list_of_arguments_paren
40244025
;
40254026

@@ -4054,7 +4055,26 @@ subroutine_call:
40544055
| system_tf_call
40554056
;
40564057

4057-
function_subroutine_call: subroutine_call
4058+
function_subroutine_call:
4059+
hierarchical_tf_identifier list_of_arguments_paren
4060+
{ init($$, ID_function_call);
4061+
stack_expr($$).operands().reserve(2);
4062+
mto($$, $1); mto($$, $2); }
4063+
| system_task_name list_of_arguments_paren
4064+
{ init($$, ID_function_call);
4065+
stack_expr($$).operands().reserve(2);
4066+
mto($$, $1); mto($$, $2); }
4067+
| system_task_name '(' data_type ')'
4068+
{ init($$, ID_function_call);
4069+
stack_expr($$).operands().reserve(2);
4070+
mto($$, $1);
4071+
unary_exprt arguments(ID_arguments, exprt(ID_type, stack_type($3)));
4072+
stack_expr($$).add_to_operands(arguments); }
4073+
| system_task_name
4074+
{ init($$, ID_function_call);
4075+
stack_expr($$).operands().reserve(2);
4076+
mto($$, $1);
4077+
}
40584078
;
40594079

40604080
event_trigger: TOK_MINUSGREATER hierarchical_event_identifier ';'

0 commit comments

Comments
 (0)