Allow more characters in unquoted property values
This commit is contained in:
parent
a61bc61c74
commit
b2c8e4a547
|
@ -95,3 +95,19 @@ a {
|
||||||
(block
|
(block
|
||||||
(declaration (property_name) (string_value))
|
(declaration (property_name) (string_value))
|
||||||
(declaration (property_name) (string_value)))))
|
(declaration (property_name) (string_value)))))
|
||||||
|
|
||||||
|
============================
|
||||||
|
URLs
|
||||||
|
============================
|
||||||
|
|
||||||
|
a {
|
||||||
|
b: http://something-else?foo=bar;
|
||||||
|
}
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
(stylesheet
|
||||||
|
(rule_set
|
||||||
|
(selectors (tag_name))
|
||||||
|
(block
|
||||||
|
(declaration (property_name) (plain_value)))))
|
||||||
|
|
|
@ -67,8 +67,8 @@ a[b] {}
|
||||||
|
|
||||||
(stylesheet
|
(stylesheet
|
||||||
(rule_set (selectors (attribute_selector (attribute_name))) (block))
|
(rule_set (selectors (attribute_selector (attribute_name))) (block))
|
||||||
(rule_set (selectors (attribute_selector (attribute_name) (keyword_value))) (block))
|
(rule_set (selectors (attribute_selector (attribute_name) (plain_value))) (block))
|
||||||
(rule_set (selectors (attribute_selector (attribute_name) (keyword_value))) (block))
|
(rule_set (selectors (attribute_selector (attribute_name) (plain_value))) (block))
|
||||||
(rule_set (selectors (attribute_selector (tag_name) (attribute_name))) (block)))
|
(rule_set (selectors (attribute_selector (tag_name) (attribute_name))) (block)))
|
||||||
|
|
||||||
=========================
|
=========================
|
||||||
|
|
|
@ -33,11 +33,11 @@ Media statements
|
||||||
(binary_query
|
(binary_query
|
||||||
(keyword_query)
|
(keyword_query)
|
||||||
(feature_query (feature_name) (integer_value (unit))))
|
(feature_query (feature_name) (integer_value (unit))))
|
||||||
(feature_query (feature_name) (keyword_value)))
|
(feature_query (feature_name) (plain_value)))
|
||||||
(block))
|
(block))
|
||||||
(media_statement
|
(media_statement
|
||||||
(feature_query (feature_name) (integer_value (unit)))
|
(feature_query (feature_name) (integer_value (unit)))
|
||||||
(binary_query (keyword_query) (feature_query (feature_name) (keyword_value)))
|
(binary_query (keyword_query) (feature_query (feature_name) (plain_value)))
|
||||||
(block))
|
(block))
|
||||||
(media_statement
|
(media_statement
|
||||||
(binary_query (negated_query (keyword_query)) (parenthesized_query (keyword_query)))
|
(binary_query (negated_query (keyword_query)) (parenthesized_query (keyword_query)))
|
||||||
|
|
|
@ -180,7 +180,8 @@ module.exports = grammar({
|
||||||
// Property Values
|
// Property Values
|
||||||
|
|
||||||
_value: $ => choice(
|
_value: $ => choice(
|
||||||
alias($.identifier, $.keyword_value),
|
alias($.identifier, $.plain_value),
|
||||||
|
$.plain_value,
|
||||||
$.color_value,
|
$.color_value,
|
||||||
$.integer_value,
|
$.integer_value,
|
||||||
$.float_value,
|
$.float_value,
|
||||||
|
@ -238,6 +239,8 @@ module.exports = grammar({
|
||||||
|
|
||||||
identifier: $ => /[a-zA-Z-_][a-zA-Z0-9-_]*/,
|
identifier: $ => /[a-zA-Z-_][a-zA-Z0-9-_]*/,
|
||||||
|
|
||||||
|
plain_value: $ => /[a-zA-Z-_][^;()\[\]\s]*/,
|
||||||
|
|
||||||
at_keyword: $ => /@[a-zA-Z-_]+/,
|
at_keyword: $ => /@[a-zA-Z-_]+/,
|
||||||
|
|
||||||
comment: $ => token(choice(
|
comment: $ => token(choice(
|
||||||
|
|
|
@ -768,7 +768,11 @@
|
||||||
"name": "identifier"
|
"name": "identifier"
|
||||||
},
|
},
|
||||||
"named": true,
|
"named": true,
|
||||||
"value": "keyword_value"
|
"value": "plain_value"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "SYMBOL",
|
||||||
|
"name": "plain_value"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "SYMBOL",
|
"type": "SYMBOL",
|
||||||
|
@ -1134,6 +1138,10 @@
|
||||||
"type": "PATTERN",
|
"type": "PATTERN",
|
||||||
"value": "[a-zA-Z-_][a-zA-Z0-9-_]*"
|
"value": "[a-zA-Z-_][a-zA-Z0-9-_]*"
|
||||||
},
|
},
|
||||||
|
"plain_value": {
|
||||||
|
"type": "PATTERN",
|
||||||
|
"value": "[a-zA-Z-_][^;()\\[\\]\\s]*"
|
||||||
|
},
|
||||||
"at_keyword": {
|
"at_keyword": {
|
||||||
"type": "PATTERN",
|
"type": "PATTERN",
|
||||||
"value": "@[a-zA-Z-_]+"
|
"value": "@[a-zA-Z-_]+"
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue