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
|
||||
)),
|
||||
|
||||
color_value: $ => /#[0-9a-fA-F]{3,8}/,
|
||||
color_value: $ => seq('#', token.immediate(/[0-9a-fA-F]{3,8}/)),
|
||||
|
||||
string_value: $ => token(choice(
|
||||
seq("'", /([^'\n]|\\(.|\n))*/, "'"),
|
||||
|
|
|
@ -1126,8 +1126,20 @@
|
|||
}
|
||||
},
|
||||
"color_value": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "#"
|
||||
},
|
||||
{
|
||||
"type": "IMMEDIATE_TOKEN",
|
||||
"content": {
|
||||
"type": "PATTERN",
|
||||
"value": "#[0-9a-fA-F]{3,8}"
|
||||
"value": "[0-9a-fA-F]{3,8}"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"string_value": {
|
||||
"type": "TOKEN",
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue