Treat # in color literals as a separate token
This commit is contained in:
parent
034eda815e
commit
90369e3d66
|
@ -249,7 +249,7 @@ module.exports = grammar({
|
||||||
$.call_expression
|
$.call_expression
|
||||||
)),
|
)),
|
||||||
|
|
||||||
color_value: $ => /#[0-9a-fA-F]{3,8}/,
|
color_value: $ => seq('#', token.immediate(/[0-9a-fA-F]{3,8}/)),
|
||||||
|
|
||||||
string_value: $ => token(choice(
|
string_value: $ => token(choice(
|
||||||
seq("'", /([^'\n]|\\(.|\n))*/, "'"),
|
seq("'", /([^'\n]|\\(.|\n))*/, "'"),
|
||||||
|
|
|
@ -1126,8 +1126,20 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"color_value": {
|
"color_value": {
|
||||||
"type": "PATTERN",
|
"type": "SEQ",
|
||||||
"value": "#[0-9a-fA-F]{3,8}"
|
"members": [
|
||||||
|
{
|
||||||
|
"type": "STRING",
|
||||||
|
"value": "#"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "IMMEDIATE_TOKEN",
|
||||||
|
"content": {
|
||||||
|
"type": "PATTERN",
|
||||||
|
"value": "[0-9a-fA-F]{3,8}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"string_value": {
|
"string_value": {
|
||||||
"type": "TOKEN",
|
"type": "TOKEN",
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue