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
|
(expansion
|
||||||
(variable)))))
|
(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: ($) =>
|
label_pair: ($) =>
|
||||||
seq(
|
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("="),
|
token.immediate("="),
|
||||||
field("value",
|
field("value",
|
||||||
choice(
|
choice(
|
||||||
|
|
|
@ -424,6 +424,14 @@
|
||||||
"multiple": false,
|
"multiple": false,
|
||||||
"required": true,
|
"required": true,
|
||||||
"types": [
|
"types": [
|
||||||
|
{
|
||||||
|
"type": "double_quoted_string",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "single_quoted_string",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "unquoted_string",
|
"type": "unquoted_string",
|
||||||
"named": true
|
"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