fix comment in string
This commit is contained in:
parent
1a4be28021
commit
90bb1822c1
4 changed files with 27 additions and 12 deletions
|
@ -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]+/,
|
||||||
|
|
||||||
|
|
|
@ -1122,17 +1122,21 @@
|
||||||
"line_comment": {
|
"line_comment": {
|
||||||
"type": "TOKEN",
|
"type": "TOKEN",
|
||||||
"content": {
|
"content": {
|
||||||
"type": "SEQ",
|
"type": "PREC",
|
||||||
"members": [
|
"value": -2,
|
||||||
{
|
"content": {
|
||||||
"type": "STRING",
|
"type": "SEQ",
|
||||||
"value": "#"
|
"members": [
|
||||||
},
|
{
|
||||||
{
|
"type": "STRING",
|
||||||
"type": "PATTERN",
|
"value": "#"
|
||||||
"value": ".*"
|
},
|
||||||
}
|
{
|
||||||
]
|
"type": "PATTERN",
|
||||||
|
"value": ".*"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"_word": {
|
"_word": {
|
||||||
|
|
BIN
src/parser.c
BIN
src/parser.c
Binary file not shown.
|
@ -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))
|
||||||
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue