Skip to content

Commit

Permalink
fix: structural expression with extra inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
dlvandenberg committed Jul 15, 2024
1 parent 5c9b47c commit 8ab7deb
Show file tree
Hide file tree
Showing 5 changed files with 8,564 additions and 8,271 deletions.
18 changes: 10 additions & 8 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,12 @@ module.exports = grammar(HTML, {
_else_template_expression: ($) =>
seq(';', alias('else', $.special_keyword), $.identifier),
_context_expression: ($) =>
seq(';', alias('context', $.special_keyword), ':', $.expression),
seq(
';',
choice(alias('context', $.special_keyword), field('named', $.identifier)),
':',
$._any_expression,
),

// ---------- Bindings ----------
property_binding: ($) => seq('[', $.binding_name, ']', $._binding_assignment),
Expand Down Expand Up @@ -432,13 +437,10 @@ module.exports = grammar(HTML, {

// Nullish coalescing expression
nullish_coalescing_expression: ($) =>
prec.right(
PREC.CALL,
seq(
field('condition', $._any_expression),
alias('??', $.coalescing_operator),
field('default', $._primitive),
),
seq(
field('condition', $._any_expression),
alias('??', $.coalescing_operator),
field('default', $._primitive),
),

// Conditional expression
Expand Down
89 changes: 51 additions & 38 deletions src/grammar.json

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

10 changes: 10 additions & 0 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 8ab7deb

Please sign in to comment.