parent
0003298cb8
commit
fdcb5613a5
5 changed files with 59 additions and 10 deletions
|
@ -199,14 +199,15 @@ module.exports = grammar({
|
|||
|
||||
_identifier: ($) =>
|
||||
seq(
|
||||
choice(/[\w\d$-]/, $.escape_sequence),
|
||||
choice(token(prec(PREC.IDENTIFIER, /[\w\d$-]/)), $.escape_sequence),
|
||||
repeat(
|
||||
choice(
|
||||
$.escape_sequence,
|
||||
token(prec(PREC.IDENTIFIER, /([\w\d'"$(),]+)?( +|-)[\w\d'"$()]+/))
|
||||
token(prec(PREC.IDENTIFIER, /[\w\d'"$(),]+/)),
|
||||
token(prec(PREC.IDENTIFIER, /( +|-)[\w\d'"$()]+/))
|
||||
)
|
||||
),
|
||||
optional(/[\w\d'"$()]+/),
|
||||
optional(token(prec(PREC.IDENTIFIER, /[\w\d'"$()]+/))),
|
||||
optional($._dash)
|
||||
),
|
||||
|
||||
|
@ -388,7 +389,7 @@ module.exports = grammar({
|
|||
token(
|
||||
prec(
|
||||
PREC.UNQUOTED_STRING,
|
||||
/[^'"`\\|\n\s;{}\[\]]([^\\\n;{}\[\]]*[^\\\n\s;{}\[\]])?/
|
||||
/[^'"`\\|\n\s;{}\[\]][^\\\n;{}\[\]]*[^\\\n\s;{}\[\]]?/
|
||||
)
|
||||
)
|
||||
)
|
||||
|
|
|
@ -866,8 +866,15 @@
|
|||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "PATTERN",
|
||||
"value": "[\\w\\d$-]"
|
||||
"type": "TOKEN",
|
||||
"content": {
|
||||
"type": "PREC",
|
||||
"value": 0,
|
||||
"content": {
|
||||
"type": "PATTERN",
|
||||
"value": "[\\w\\d$-]"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
|
@ -891,7 +898,18 @@
|
|||
"value": 0,
|
||||
"content": {
|
||||
"type": "PATTERN",
|
||||
"value": "([\\w\\d'\"$(),]+)?( +|-)[\\w\\d'\"$()]+"
|
||||
"value": "[\\w\\d'\"$(),]+"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "TOKEN",
|
||||
"content": {
|
||||
"type": "PREC",
|
||||
"value": 0,
|
||||
"content": {
|
||||
"type": "PATTERN",
|
||||
"value": "( +|-)[\\w\\d'\"$()]+"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -902,8 +920,15 @@
|
|||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "PATTERN",
|
||||
"value": "[\\w\\d'\"$()]+"
|
||||
"type": "TOKEN",
|
||||
"content": {
|
||||
"type": "PREC",
|
||||
"value": 0,
|
||||
"content": {
|
||||
"type": "PATTERN",
|
||||
"value": "[\\w\\d'\"$()]+"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "BLANK"
|
||||
|
@ -2047,7 +2072,7 @@
|
|||
"value": -1,
|
||||
"content": {
|
||||
"type": "PATTERN",
|
||||
"value": "[^'\"`\\\\|\\n\\s;{}\\[\\]]([^\\\\\\n;{}\\[\\]]*[^\\\\\\n\\s;{}\\[\\]])?"
|
||||
"value": "[^'\"`\\\\|\\n\\s;{}\\[\\]][^\\\\\\n;{}\\[\\]]*[^\\\\\\n\\s;{}\\[\\]]?"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
BIN
src/parser.c
BIN
src/parser.c
Binary file not shown.
|
@ -1,3 +1,26 @@
|
|||
================================================================================
|
||||
Declare unquoted shape identifier with escape sequence (issue #21)
|
||||
================================================================================
|
||||
hello\[world\]
|
||||
\#ello\[world\]
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(source_file
|
||||
(shape
|
||||
(shape_key
|
||||
(escape_sequence)
|
||||
(escape_sequence)
|
||||
)
|
||||
)
|
||||
(shape
|
||||
(shape_key
|
||||
(escape_sequence)
|
||||
(escape_sequence)
|
||||
(escape_sequence)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
================================================================================
|
||||
Handle end of file (issue #1)
|
||||
================================================================================
|
||||
|
|
Binary file not shown.
Loading…
Reference in a new issue