fix: template expression precedence
This commit is contained in:
103
src/grammar.json
103
src/grammar.json
@@ -1187,30 +1187,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"_template": {
|
||||
"type": "PREC_LEFT",
|
||||
"value": 0,
|
||||
"content": {
|
||||
"type": "REPEAT1",
|
||||
"content": {
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "template_literal"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "template_interpolation"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "template_directive"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"quoted_template": {
|
||||
"type": "PREC",
|
||||
"value": 1,
|
||||
@@ -1286,6 +1262,26 @@
|
||||
"type": "STRING",
|
||||
"value": "~"
|
||||
},
|
||||
"_template": {
|
||||
"type": "REPEAT1",
|
||||
"content": {
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "template_interpolation"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "template_directive"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "template_literal"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"template_literal": {
|
||||
"type": "PREC_RIGHT",
|
||||
"value": 0,
|
||||
@@ -1504,14 +1500,43 @@
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "template_if_branch"
|
||||
"name": "template_if_intro"
|
||||
},
|
||||
{
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "template_else_branch"
|
||||
"name": "_template"
|
||||
},
|
||||
{
|
||||
"type": "BLANK"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "template_else_intro"
|
||||
},
|
||||
{
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_template"
|
||||
},
|
||||
{
|
||||
"type": "BLANK"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "BLANK"
|
||||
@@ -1524,19 +1549,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"template_if_branch": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "template_if_intro"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_template"
|
||||
}
|
||||
]
|
||||
},
|
||||
"template_if_intro": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
@@ -1582,19 +1594,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"template_else_branch": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "template_else_intro"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_template"
|
||||
}
|
||||
]
|
||||
},
|
||||
"template_else_intro": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
|
||||
Reference in New Issue
Block a user