Skip to content

Commit 12fe553

Browse files
committed
fix: correct parsing of map types in function parameters
1 parent 3c3775f commit 12fe553

File tree

4 files changed

+21656
-21116
lines changed

4 files changed

+21656
-21116
lines changed

grammar.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -246,10 +246,10 @@ module.exports = grammar({
246246
')',
247247
),
248248

249-
parameter_declaration: $ => prec.left(seq(
249+
parameter_declaration: $ => seq(
250250
commaSep(field('name', $.identifier)),
251251
field('type', $._type),
252-
)),
252+
),
253253

254254
variadic_parameter_declaration: $ => seq(
255255
field('name', optional($.identifier)),
@@ -302,7 +302,7 @@ module.exports = grammar({
302302
$.interface_type,
303303
$.array_type,
304304
$.slice_type,
305-
$.map_type,
305+
prec.dynamic(3, $.map_type),
306306
$.channel_type,
307307
$.function_type,
308308
$.negated_type,

src/grammar.json

+54-54
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)