Add important

This commit is contained in:
Max Brunsfeld 2018-10-26 11:42:36 -07:00
parent b2c8e4a547
commit d9f5080cca
4 changed files with 1945 additions and 1804 deletions

View File

@ -111,3 +111,19 @@ a {
(selectors (tag_name)) (selectors (tag_name))
(block (block
(declaration (property_name) (plain_value))))) (declaration (property_name) (plain_value)))))
============================
Important declarations
============================
a {
b: c !important;
}
---
(stylesheet
(rule_set
(selectors (tag_name))
(block
(declaration (property_name) (plain_value) (important)))))

View File

@ -139,9 +139,12 @@ module.exports = grammar({
optional(','), optional(','),
$._value $._value
)), )),
optional($.important),
';' ';'
)), )),
important: $ => '!important',
// Media queries // Media queries
_query: $ => choice( _query: $ => choice(

16
src/grammar.json vendored
View File

@ -627,6 +627,18 @@
] ]
} }
}, },
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "important"
},
{
"type": "BLANK"
}
]
},
{ {
"type": "STRING", "type": "STRING",
"value": ";" "value": ";"
@ -634,6 +646,10 @@
] ]
} }
}, },
"important": {
"type": "STRING",
"value": "!important"
},
"_query": { "_query": {
"type": "CHOICE", "type": "CHOICE",
"members": [ "members": [

3714
src/parser.c vendored

File diff suppressed because it is too large Load Diff