Skip to content

Commit 684ae3a

Browse files
committed
fix: super in a scoped identifiers name
1 parent f859994 commit 684ae3a

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

corpus/expressions.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,6 +1081,24 @@ Scoped functions with macros as types
10811081
(identifier))
10821082
(arguments))))
10831083

1084+
================================================================================
1085+
Scoped identifier with nested super
1086+
================================================================================
1087+
1088+
super::super::foo();
1089+
1090+
--------------------------------------------------------------------------------
1091+
1092+
(source_file
1093+
(expression_statement
1094+
(call_expression
1095+
(scoped_identifier
1096+
(scoped_identifier
1097+
(super)
1098+
(super))
1099+
(identifier))
1100+
(arguments))))
1101+
10841102
================================================================================
10851103
Generic functions
10861104
================================================================================

grammar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ module.exports = grammar({
917917
alias($.generic_type_with_turbofish, $.generic_type)
918918
))),
919919
'::',
920-
field('name', $.identifier)
920+
field('name', choice($.identifier, $.super)),
921921
),
922922

923923
scoped_type_identifier_in_expression_position: $ => prec(-2, seq(

0 commit comments

Comments
 (0)