fix comment in string

This commit is contained in:
Dmitriy Pleshevskiy 2022-12-08 02:04:36 +03:00
parent 1a4be28021
commit 90bb1822c1
Signed by: pleshevskiy
GPG key ID: 1B59187B161C0215
4 changed files with 27 additions and 12 deletions

View file

@ -188,7 +188,7 @@ module.exports = grammar({
seq("`", repeat(token.immediate(/[^`\n]+/)), "`")
),
line_comment: ($) => token(seq("#", /.*/)),
line_comment: ($) => token(prec(-2, seq("#", /.*/))),
_word: ($) => /[\w\d]+/,

View file

@ -1122,17 +1122,21 @@
"line_comment": {
"type": "TOKEN",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "#"
},
{
"type": "PATTERN",
"value": ".*"
}
]
"type": "PREC",
"value": -2,
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "#"
},
{
"type": "PATTERN",
"value": ".*"
}
]
}
}
},
"_word": {

Binary file not shown.

View file

@ -97,3 +97,14 @@ foo.style: { opacity: 5 }
)
)
================================================================================
Color in string
================================================================================
foo.style.fill: "#ffffff";
--------------------------------------------------------------------------------
(source_file
(shape_key) (dot) (attr_key) (dot) (attr_key) (attr_value (string))
)