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]+/)), "`") seq("`", repeat(token.immediate(/[^`\n]+/)), "`")
), ),
line_comment: ($) => token(seq("#", /.*/)), line_comment: ($) => token(prec(-2, seq("#", /.*/))),
_word: ($) => /[\w\d]+/, _word: ($) => /[\w\d]+/,

View file

@ -1121,6 +1121,9 @@
}, },
"line_comment": { "line_comment": {
"type": "TOKEN", "type": "TOKEN",
"content": {
"type": "PREC",
"value": -2,
"content": { "content": {
"type": "SEQ", "type": "SEQ",
"members": [ "members": [
@ -1134,6 +1137,7 @@
} }
] ]
} }
}
}, },
"_word": { "_word": {
"type": "PATTERN", "type": "PATTERN",

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))
)