Skip to content

Commit 1f52638

Browse files
committed
Add dynamic precedence to builtin methods
1 parent e975694 commit 1f52638

File tree

294 files changed

+30212
-19796
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

294 files changed

+30212
-19796
lines changed

grammar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3716,7 +3716,7 @@ const rules = {
37163716
repeat($.attribute_instance),
37173717
field('arguments', optseq('(', optional($.list_of_arguments), ')'))
37183718
),
3719-
$._built_in_method_call
3719+
prec.dynamic(1, $._built_in_method_call)
37203720
)),
37213721

37223722
_built_in_method_call: $ => choice(

src/grammar.json

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/parser.c

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/corpus/core/subroutines/call_method_cond_expr.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,13 @@ endfunction
2525
(primary
2626
(function_subroutine_call
2727
(subroutine_call
28-
(tf_call
29-
(hierarchical_identifier
30-
(simple_identifier)
31-
(simple_identifier))))))))
28+
(method_call
29+
(primary
30+
(hierarchical_identifier
31+
(simple_identifier)))
32+
(method_call_body
33+
(array_or_queue_method_call
34+
(array_or_queue_method_name)))))))))
3235
(statement_or_null
3336
(statement
3437
(statement_item

test/corpus/core/subroutines/call_method_cond_expr_rhs.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,13 @@ endfunction
3030
(primary
3131
(function_subroutine_call
3232
(subroutine_call
33-
(tf_call
34-
(hierarchical_identifier
35-
(simple_identifier)
36-
(simple_identifier)))))))))
33+
(method_call
34+
(primary
35+
(hierarchical_identifier
36+
(simple_identifier)))
37+
(method_call_body
38+
(array_or_queue_method_call
39+
(array_or_queue_method_name))))))))))
3740
(statement_or_null
3841
(statement
3942
(statement_item

test/corpus/core/subroutines/call_method_cond_expr_rhs_assignment_ERROR.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,13 @@ endfunction
2828
(primary
2929
(function_subroutine_call
3030
(subroutine_call
31-
(tf_call
32-
(hierarchical_identifier
33-
(simple_identifier)
34-
(simple_identifier))))))))
31+
(method_call
32+
(primary
33+
(hierarchical_identifier
34+
(simple_identifier)))
35+
(method_call_body
36+
(array_or_queue_method_call
37+
(array_or_queue_method_name)))))))))
3538
(statement_or_null
3639
(statement
3740
(statement_item

test/corpus/core/subroutines/inside_index.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ endfunction
2626
(primary
2727
(function_subroutine_call
2828
(subroutine_call
29-
(tf_call
30-
(hierarchical_identifier
31-
(simple_identifier)
32-
(simple_identifier))))))))))))))))
29+
(method_call
30+
(primary
31+
(hierarchical_identifier
32+
(simple_identifier)))
33+
(method_call_body
34+
(array_or_queue_method_call
35+
(array_or_queue_method_name)))))))))))))))))

test/corpus/cva6/amo_buffer.txt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -452,9 +452,15 @@ endmodule
452452
(simple_identifier)))
453453
(expression
454454
(primary
455-
(hierarchical_identifier
456-
(simple_identifier)
457-
(simple_identifier)))))))
455+
(function_subroutine_call
456+
(subroutine_call
457+
(method_call
458+
(primary
459+
(hierarchical_identifier
460+
(simple_identifier)))
461+
(method_call_body
462+
(array_or_queue_method_call
463+
(array_or_queue_method_name)))))))))))
458464
(continuous_assign
459465
(list_of_net_assignments
460466
(net_assignment

test/corpus/cva6/ariane_gate_tb.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3644,10 +3644,13 @@ endmodule
36443644
(primary
36453645
(function_subroutine_call
36463646
(subroutine_call
3647-
(tf_call
3648-
(hierarchical_identifier
3649-
(simple_identifier)
3650-
(simple_identifier))))))))))))))))
3647+
(method_call
3648+
(primary
3649+
(hierarchical_identifier
3650+
(simple_identifier)))
3651+
(method_call_body
3652+
(string_method_call
3653+
(string_method_name)))))))))))))))))
36513654
(statement_or_null
36523655
(statement
36533656
(statement_item

test/corpus/cva6/axi_adapter.txt

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5108,10 +5108,21 @@ endmodule
51085108
(cond_predicate
51095109
(expression
51105110
(primary
5111-
(hierarchical_identifier
5112-
(simple_identifier)
5113-
(simple_identifier)
5114-
(simple_identifier)))))
5111+
(function_subroutine_call
5112+
(subroutine_call
5113+
(method_call
5114+
(primary
5115+
(function_subroutine_call
5116+
(subroutine_call
5117+
(method_call
5118+
(primary
5119+
(hierarchical_identifier
5120+
(simple_identifier)))
5121+
(method_call_body
5122+
name: (simple_identifier))))))
5123+
(method_call_body
5124+
(enum_or_associative_array_method_call
5125+
(enum_or_associative_array_method_name)))))))))
51155126
(statement_or_null
51165127
(statement
51175128
(statement_item

0 commit comments

Comments
 (0)