Merge pull request #39 from kmicklas/quoted-label-keys

Support quoted LABEL keys
This commit is contained in:
Camden Cheek 2023-09-27 16:37:17 -05:00 committed by GitHub
commit 15c087dc95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 4133 additions and 3936 deletions

View file

@ -93,5 +93,17 @@ USER foo$FOO:bar$BAR
group: (unquoted_string
(expansion
(variable)))))
==================
Quoted key
==================
LABEL "key"="value"
---
(source_file
(label_instruction
(label_pair
key: (double_quoted_string)
value: (double_quoted_string))))

View file

@ -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(

View file

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

File diff suppressed because it is too large Load diff