Skip to content

Commit 3cebcdd

Browse files
committed
fix: make optional types T? explicit
1 parent 81d9245 commit 3cebcdd

File tree

5 files changed

+112
-88
lines changed

5 files changed

+112
-88
lines changed

grammar.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,11 @@ module.exports = grammar({
777777

778778
/* Types */
779779

780-
_type: ($) => choice($.map_type, $.bounced_type, $._simple_type),
780+
_type: ($) => choice(
781+
$.map_type,
782+
$.bounced_type,
783+
$.optional_type,
784+
alias($._type_identifier, $.type_identifier)),
781785

782786
map_type: ($) =>
783787
seq(
@@ -799,8 +803,7 @@ module.exports = grammar({
799803
">",
800804
),
801805

802-
_simple_type: ($) =>
803-
seq(alias($._type_identifier, $.type_identifier), optional("?")),
806+
optional_type: ($) => seq(alias($._type_identifier, $.type_identifier), "?"),
804807

805808
_type_identifier: (_) => /[A-Z][a-zA-Z0-9_]*/,
806809

src/grammar.json

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

src/node-types.json

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

0 commit comments

Comments
 (0)