Skip to content

Commit

Permalink
fix: static parameter vs char
Browse files Browse the repository at this point in the history
  • Loading branch information
Nsidorenco committed Jun 17, 2024
1 parent 7f9991f commit 004d8d9
Show file tree
Hide file tree
Showing 5 changed files with 382,894 additions and 379,951 deletions.
13 changes: 8 additions & 5 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -998,16 +998,16 @@ module.exports = grammar({
seq($.type, repeat(prec.left(PREC.COMMA - 1, seq(",", $.type)))),

_static_type_identifier: ($) =>
prec(10, seq(choice("^", "'"), $.identifier)),
prec(10, seq(choice("^", token(prec(100, "'"))), $.identifier)),

_static_parameter: ($) =>
// $.named_static_parameter,
choice($.static_parameter_value, $.named_static_parameter),

named_static_parameter: ($) =>
prec(3, seq($.identifier, "=", $.static_parameter_value)),

static_parameter_value: ($) =>
prec(-1, seq($.const, optional($._expression))),
static_parameter_value: ($) => seq($.const, optional($._expression)),

type_attribute: ($) =>
choice(
Expand All @@ -1019,7 +1019,7 @@ module.exports = grammar({
type_attributes: ($) =>
seq(
$.type_attribute,
repeat(prec.left(PREC.COMMA, seq(",", $.type_attribute))),
repeat(prec.right(PREC.COMMA, seq(",", $.type_attribute))),
),

atomic_type: ($) =>
Expand Down Expand Up @@ -1539,7 +1539,10 @@ module.exports = grammar({
),

char: (_) =>
/'([^\n\t\r\u0008\a\f\v'\\]|\\["\'ntbrafv]|\\[0-9]{3}|\\u[0-9a-fA-F]{4})*'B?/,
prec(
-1,
/'([^\n\t\r\u0008\a\f\v'\\]|\\["\'ntbrafv]|\\[0-9]{3}|\\u[0-9a-fA-F]{4})*'B?/,
),

format_string_eval: ($) =>
seq(token.immediate(prec(1000, "{")), $._expression, "}"),
Expand Down
21 changes: 16 additions & 5 deletions src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions src/node-types.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 004d8d9

Please sign in to comment.