Skip to content

Commit 8a1d8b5

Browse files
committed
Add higher dyn precedence to implicit_class_handle for method calls
1 parent 48dfe3c commit 8a1d8b5

Some content is hidden

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

57 files changed

+863
-859
lines changed

grammar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3754,7 +3754,7 @@ const rules = {
37543754

37553755
_method_call_root: $ => choice(
37563756
$.primary,
3757-
$.implicit_class_handle,
3757+
prec.dynamic(1, $.implicit_class_handle), // 'this' also belongs to $.primary. Setting this prec allows detecting 'this' as something different as a regular identifier
37583758
$.class_type, // Out of LRM: Added to support calling parameterized static methods
37593759
$.text_macro_usage, // Out of LRM, Added to fix parsing errors in UVM
37603760
),

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: 26 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/corpus/core/subroutines/call_this_method_rhs.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ endfunction
2828
(function_subroutine_call
2929
(subroutine_call
3030
(method_call
31-
(primary)
31+
(implicit_class_handle)
3232
(method_call_body
3333
name: (simple_identifier))))))))))))))))

test/corpus/core/subroutines/nested_implicit_rhs.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ endfunction
3636
(function_subroutine_call
3737
(subroutine_call
3838
(method_call
39-
(primary)
39+
(implicit_class_handle)
4040
(method_call_body
4141
name: (simple_identifier))))))
4242
(method_call_body

test/corpus/core/subroutines/nested_implicit_with_args_rhs.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ endfunction
3636
(function_subroutine_call
3737
(subroutine_call
3838
(method_call
39-
(primary)
39+
(implicit_class_handle)
4040
(method_call_body
4141
name: (simple_identifier))))))
4242
(method_call_body

test/corpus/core/subroutines/nested_many_times_implicit_args_rhs.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ endfunction
128128
(function_subroutine_call
129129
(subroutine_call
130130
(method_call
131-
(primary)
131+
(implicit_class_handle)
132132
(method_call_body
133133
name: (simple_identifier))))))
134134
(method_call_body

test/corpus/core/subroutines/nested_many_times_implicit_rhs.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ endfunction
128128
(function_subroutine_call
129129
(subroutine_call
130130
(method_call
131-
(primary)
131+
(implicit_class_handle)
132132
(method_call_body
133133
name: (simple_identifier))))))
134134
(method_call_body

test/corpus/core/subroutines/randomize_cond_expr.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ endfunction
2727
(function_subroutine_call
2828
(subroutine_call
2929
(method_call
30-
(primary)
30+
(implicit_class_handle)
3131
(method_call_body
3232
(randomize_call))))))))
3333
(statement_or_null

test/corpus/core/subroutines/randomize_cond_expr_rhs.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ endfunction
3232
(function_subroutine_call
3333
(subroutine_call
3434
(method_call
35-
(primary)
35+
(implicit_class_handle)
3636
(method_call_body
3737
(randomize_call)))))))))
3838
(statement_or_null

0 commit comments

Comments
 (0)