Skip to content

Commit edea6bf

Browse files
committed
fix: give index expressions a dynamic precedence of 1
This will have it be preferred over type instantiation expressions at runtime
1 parent e1076e5 commit edea6bf

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

grammar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -732,12 +732,12 @@ module.exports = grammar({
732732
field('field', $._field_identifier),
733733
)),
734734

735-
index_expression: $ => prec(PREC.primary, seq(
735+
index_expression: $ => prec(PREC.primary, prec.dynamic(1, seq(
736736
field('operand', $._expression),
737737
'[',
738738
field('index', $._expression),
739739
']',
740-
)),
740+
))),
741741

742742
slice_expression: $ => prec(PREC.primary, seq(
743743
field('operand', $._expression),

0 commit comments

Comments
 (0)