diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-09-14 22:38:58 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-09-14 22:38:58 +0200 |
commit | 11b47b424b7576c536216bb7e3bcbaaa65f5acd4 (patch) | |
tree | 9b82bff4d106edc1e42c29df9ce747a9115e54a9 /grammar.js | |
parent | 5ba881221f265d4ad7805b49da8a0dd273cb3887 (diff) |
Slightly tweak the grammar
Diffstat (limited to 'grammar.js')
-rw-r--r-- | grammar.js | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -39,8 +39,10 @@ module.exports = grammar({ '=', field('value', $.string) ), - id_attr: $ => seq('#', alias(token.immediate(IDENT), $.ident)), - class_attr: $ => seq('.', alias(token.immediate(IDENT), $.ident)), + id_attr: $ => seq('#', + field('name', alias(token.immediate(IDENT), $.ident))), + class_attr: $ => seq('.', + field('name', alias(token.immediate(IDENT), $.ident))), text: $ => repeat1(choice( /(\\[@}\\]|[^@}\\])+/, |