Skip to content

Commit

Permalink
fix: allow prefixed attributes with value
Browse files Browse the repository at this point in the history
  • Loading branch information
ObserverOfTime committed Feb 23, 2024
1 parent a0ccde4 commit c207b9c
Show file tree
Hide file tree
Showing 5 changed files with 1,137 additions and 1,026 deletions.
11 changes: 8 additions & 3 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,10 @@ module.exports = grammar({
dir_sep: _ => '/',

attribute: $ => choice(
$._attr_with_value,
seq(
choice($.attr_name, $.builtin_attr),
$._attr_value
),
$._prefixed_attr
),

Expand All @@ -173,10 +176,12 @@ module.exports = grammar({
alias('-', $.attr_unset),
)),
choice($.attr_name, $.builtin_attr),
prec(-1, optional(
alias($._attr_value, $.ignored_value)
))
),

_attr_with_value: $ => seq(
choice($.attr_name, $.builtin_attr),
_attr_value: $ => seq(
alias('=', $.attr_set),
choice(
prec(2, alias(
Expand Down
1 change: 1 addition & 0 deletions queries/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
(pattern_negation)
(redundant_escape)
(trailing_slash)
(ignored_value)
] @error

(comment) @comment
58 changes: 42 additions & 16 deletions src/grammar.json

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

27 changes: 27 additions & 0 deletions src/node-types.json

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

0 comments on commit c207b9c

Please sign in to comment.