Merge pull request #39 from kmicklas/quoted-label-keys
Support quoted LABEL keys
This commit is contained in:
commit
15c087dc95
|
@ -94,4 +94,16 @@ USER foo$FOO:bar$BAR
|
|||
(expansion
|
||||
(variable)))))
|
||||
|
||||
==================
|
||||
Quoted key
|
||||
==================
|
||||
|
||||
LABEL "key"="value"
|
||||
|
||||
---
|
||||
|
||||
(source_file
|
||||
(label_instruction
|
||||
(label_pair
|
||||
key: (double_quoted_string)
|
||||
value: (double_quoted_string))))
|
||||
|
|
|
@ -255,7 +255,11 @@ module.exports = grammar({
|
|||
|
||||
label_pair: ($) =>
|
||||
seq(
|
||||
field("key", alias(/[-a-zA-Z0-9\._]+/, $.unquoted_string)),
|
||||
field("key", choice(
|
||||
alias(/[-a-zA-Z0-9\._]+/, $.unquoted_string),
|
||||
$.double_quoted_string,
|
||||
$.single_quoted_string
|
||||
)),
|
||||
token.immediate("="),
|
||||
field("value",
|
||||
choice(
|
||||
|
|
|
@ -424,6 +424,14 @@
|
|||
"multiple": false,
|
||||
"required": true,
|
||||
"types": [
|
||||
{
|
||||
"type": "double_quoted_string",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "single_quoted_string",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "unquoted_string",
|
||||
"named": true
|
||||
|
|
8041
src/parser.c
8041
src/parser.c
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue