aboutsummaryrefslogtreecommitdiff
path: root/grammar.js
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-10-28 15:25:34 +0200
committerThomas Voss <mail@thomasvoss.com> 2023-10-28 15:25:34 +0200
commit4ed241343f6babdb0b954c683c1408345bbeed30 (patch)
treea8ca0308ae3d261f6a2de678de6c476c5315af9f /grammar.js
parent2483cbddd9e7a02296bb928462ba7eb22551752d (diff)
Support unicode whitespacev1.0.2
Diffstat (limited to 'grammar.js')
-rw-r--r--grammar.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/grammar.js b/grammar.js
index 5849132..8d0e5a5 100644
--- a/grammar.js
+++ b/grammar.js
@@ -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,
},
})