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

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

View file

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

View file

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

File diff suppressed because it is too large Load diff