Fix parsing of negative numbers (#12)
* Add failing test for negative numbers * Fix parsing of negative numbers * Rearrange assertion to avoid extra diff noise
This commit is contained in:
parent
9668e88916
commit
94e1023093
|
@ -86,6 +86,7 @@ a {
|
||||||
c: 5em;
|
c: 5em;
|
||||||
margin: 10E3px;
|
margin: 10E3px;
|
||||||
margin: -456.8px;
|
margin: -456.8px;
|
||||||
|
margin: -5px;
|
||||||
margin: -0.0px;
|
margin: -0.0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,6 +98,7 @@ a {
|
||||||
(declaration (property_name) (integer_value (unit)))
|
(declaration (property_name) (integer_value (unit)))
|
||||||
(declaration (property_name) (float_value (unit)))
|
(declaration (property_name) (float_value (unit)))
|
||||||
(declaration (property_name) (float_value (unit)))
|
(declaration (property_name) (float_value (unit)))
|
||||||
|
(declaration (property_name) (integer_value (unit)))
|
||||||
(declaration (property_name) (float_value (unit))))))
|
(declaration (property_name) (float_value (unit))))))
|
||||||
|
|
||||||
============================
|
============================
|
||||||
|
@ -240,5 +242,5 @@ a-property: calc(5px + var(--a-variable));
|
||||||
---
|
---
|
||||||
|
|
||||||
(stylesheet
|
(stylesheet
|
||||||
(declaration (property_name) (plain_value))
|
(declaration (property_name) (integer_value (unit)))
|
||||||
(declaration (property_name) (call_expression (function_name) (arguments (binary_expression (integer_value (unit)) (call_expression (function_name) (arguments (plain_value))))))))
|
(declaration (property_name) (call_expression (function_name) (arguments (binary_expression (integer_value (unit)) (call_expression (function_name) (arguments (plain_value))))))))
|
||||||
|
|
|
@ -333,7 +333,7 @@ module.exports = grammar({
|
||||||
')'
|
')'
|
||||||
),
|
),
|
||||||
|
|
||||||
identifier: $ => /[a-zA-Z-_][a-zA-Z0-9-_]*/,
|
identifier: $ => /(--|-?[a-zA-Z_])[a-zA-Z0-9-_]*/,
|
||||||
|
|
||||||
at_keyword: $ => /@[a-zA-Z-_]+/,
|
at_keyword: $ => /@[a-zA-Z-_]+/,
|
||||||
|
|
||||||
|
|
|
@ -1642,7 +1642,7 @@
|
||||||
},
|
},
|
||||||
"identifier": {
|
"identifier": {
|
||||||
"type": "PATTERN",
|
"type": "PATTERN",
|
||||||
"value": "[a-zA-Z-_][a-zA-Z0-9-_]*"
|
"value": "(--|-?[a-zA-Z_])[a-zA-Z0-9-_]*"
|
||||||
},
|
},
|
||||||
"at_keyword": {
|
"at_keyword": {
|
||||||
"type": "PATTERN",
|
"type": "PATTERN",
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue