Allow empty strings
This commit is contained in:
parent
9db3a5155d
commit
a34b06cb86
|
@ -37,3 +37,21 @@ a {
|
||||||
(block
|
(block
|
||||||
(declaration (property_name) (color_value))
|
(declaration (property_name) (color_value))
|
||||||
(declaration (property_name) (color_value)))))
|
(declaration (property_name) (color_value)))))
|
||||||
|
|
||||||
|
============================
|
||||||
|
Strings
|
||||||
|
============================
|
||||||
|
|
||||||
|
a {
|
||||||
|
b: '';
|
||||||
|
c: '\'hi\'';
|
||||||
|
}
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
(stylesheet
|
||||||
|
(rule_set
|
||||||
|
(selectors (tag_name))
|
||||||
|
(block
|
||||||
|
(declaration (property_name) (string_value))
|
||||||
|
(declaration (property_name) (string_value)))))
|
||||||
|
|
|
@ -191,8 +191,8 @@ module.exports = grammar({
|
||||||
color_value: $ => /#[0-9a-fA-F]{3,8}/,
|
color_value: $ => /#[0-9a-fA-F]{3,8}/,
|
||||||
|
|
||||||
string_value: $ => token(choice(
|
string_value: $ => token(choice(
|
||||||
seq("'", /([^'\n]|\\(.|\n))+/, "'"),
|
seq("'", /([^'\n]|\\(.|\n))*/, "'"),
|
||||||
seq('"', /([^"\n]|\\(.|\n))+/, '"')
|
seq('"', /([^"\n]|\\(.|\n))*/, '"')
|
||||||
)),
|
)),
|
||||||
|
|
||||||
integer_value: $ => seq(
|
integer_value: $ => seq(
|
||||||
|
|
|
@ -810,7 +810,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "PATTERN",
|
"type": "PATTERN",
|
||||||
"value": "([^']|\\\\.)+"
|
"value": "([^'\\n]|\\\\(.|\\n))*"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "STRING",
|
"type": "STRING",
|
||||||
|
@ -827,7 +827,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "PATTERN",
|
"type": "PATTERN",
|
||||||
"value": "([^\"]|\\\\.)+"
|
"value": "([^\"\\n]|\\\\(.|\\n))*"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "STRING",
|
"type": "STRING",
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue