diff options
author | Thomas Voss <mail@thomasvoss.com> | 2023-10-28 15:25:34 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2023-10-28 15:25:34 +0200 |
commit | 4ed241343f6babdb0b954c683c1408345bbeed30 (patch) | |
tree | a8ca0308ae3d261f6a2de678de6c476c5315af9f /grammar.js | |
parent | 2483cbddd9e7a02296bb928462ba7eb22551752d (diff) |
Support unicode whitespacev1.0.2
Diffstat (limited to 'grammar.js')
-rw-r--r-- | grammar.js | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -1,6 +1,6 @@ module.exports = grammar({ name: 'gsp', - + extras: $ => [$._S], rules: { source_file: $ => repeat($.node), @@ -43,10 +43,12 @@ module.exports = grammar({ ), ), - class_shorthand: $ => /\.[^\s]+/, - id_shorthand: $ => /#[^\s]+/, + class_shorthand: $ => /\.[^\p{White_Space}]+/u, + id_shorthand: $ => /#[^\p{White_Space}]+/u, attribute_name: $ => /[a-zA-Z0-9_-]+/, attribute_value: $ => /"(\\.|[^"\\])*"/, + + _S: $ => /\p{White_Space}*/u, }, }) |