allow empty templates and template interpolations

This commit is contained in:
mhoffm
2021-06-27 13:54:05 +02:00
parent 13acf1bcc7
commit 6c5f3eba28
5 changed files with 10369 additions and 10289 deletions

View File

@@ -1182,24 +1182,32 @@
"name": "_quoted_template_start"
},
{
"type": "REPEAT",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "template_literal"
},
{
"type": "SYMBOL",
"name": "template_interpolation"
},
{
"type": "SYMBOL",
"name": "template_directive"
"type": "CHOICE",
"members": [
{
"type": "REPEAT",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "template_literal"
},
{
"type": "SYMBOL",
"name": "template_interpolation"
},
{
"type": "SYMBOL",
"name": "template_directive"
}
]
}
]
}
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
@@ -1220,24 +1228,32 @@
"name": "heredoc_identifier"
},
{
"type": "REPEAT",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "template_literal"
},
{
"type": "SYMBOL",
"name": "template_interpolation"
},
{
"type": "SYMBOL",
"name": "template_directive"
"type": "CHOICE",
"members": [
{
"type": "REPEAT",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "template_literal"
},
{
"type": "SYMBOL",
"name": "template_interpolation"
},
{
"type": "SYMBOL",
"name": "template_directive"
}
]
}
]
}
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
@@ -1293,8 +1309,16 @@
]
},
{
"type": "SYMBOL",
"name": "expression"
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "expression"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",

View File

@@ -669,7 +669,7 @@
"fields": {},
"children": {
"multiple": true,
"required": true,
"required": false,
"types": [
{
"type": "expression",

20533
src/parser.c

File diff suppressed because it is too large Load Diff