Skip to content

Commit

Permalink
Simplify regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Mango0x45 committed Oct 30, 2023
1 parent 4dde2d9 commit 36d4164
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ module.exports = grammar({
),
),

class_shorthand: $ => /\.[^\p{White_Space}]+/u,
id_shorthand: $ => /#[^\p{White_Space}]+/u,
class_shorthand: $ => /\.\P{White_Space}+/u,
id_shorthand: $ => /#\P{White_Space}+/u,

attribute_name: $ => /[a-zA-Z0-9_-]+/,
attribute_value: $ => /"(\\.|[^"\\])*"/,
Expand Down
4 changes: 2 additions & 2 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,11 @@
},
"class_shorthand": {
"type": "PATTERN",
"value": "\\.[^\\p{White_Space}]+"
"value": "\\.\\P{White_Space}+"
},
"id_shorthand": {
"type": "PATTERN",
"value": "#[^\\p{White_Space}]+"
"value": "#\\P{White_Space}+"
},
"attribute_name": {
"type": "PATTERN",
Expand Down

0 comments on commit 36d4164

Please sign in to comment.