fix grammar
This commit is contained in:
186
src/grammar.json
186
src/grammar.json
@@ -885,8 +885,8 @@
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": ","
|
||||
"type": "SYMBOL",
|
||||
"name": "_comma"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
@@ -1344,6 +1344,10 @@
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "template_for"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "template_if"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -1487,6 +1491,184 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"template_if": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "template_if_branch"
|
||||
},
|
||||
{
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "template_else_branch"
|
||||
},
|
||||
{
|
||||
"type": "BLANK"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "template_if_end"
|
||||
}
|
||||
]
|
||||
},
|
||||
"template_if_branch": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "template_if_intro"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_template"
|
||||
}
|
||||
]
|
||||
},
|
||||
"template_if_intro": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "template_directive_start"
|
||||
},
|
||||
{
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "strip_marker"
|
||||
},
|
||||
{
|
||||
"type": "BLANK"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "if"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "expression"
|
||||
},
|
||||
{
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "strip_marker"
|
||||
},
|
||||
{
|
||||
"type": "BLANK"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "template_directive_end"
|
||||
}
|
||||
]
|
||||
},
|
||||
"template_else_branch": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "template_else_intro"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_template"
|
||||
}
|
||||
]
|
||||
},
|
||||
"template_else_intro": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "template_directive_start"
|
||||
},
|
||||
{
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "strip_marker"
|
||||
},
|
||||
{
|
||||
"type": "BLANK"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "else"
|
||||
},
|
||||
{
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "strip_marker"
|
||||
},
|
||||
{
|
||||
"type": "BLANK"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "template_directive_end"
|
||||
}
|
||||
]
|
||||
},
|
||||
"template_if_end": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "template_directive_start"
|
||||
},
|
||||
{
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "strip_marker"
|
||||
},
|
||||
{
|
||||
"type": "BLANK"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "endif"
|
||||
},
|
||||
{
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "strip_marker"
|
||||
},
|
||||
{
|
||||
"type": "BLANK"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "template_directive_end"
|
||||
}
|
||||
]
|
||||
},
|
||||
"comment": {
|
||||
"type": "TOKEN",
|
||||
"content": {
|
||||
|
||||
@@ -729,6 +729,60 @@
|
||||
{
|
||||
"type": "template_for",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "template_if",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "template_else_branch",
|
||||
"named": true,
|
||||
"fields": {},
|
||||
"children": {
|
||||
"multiple": true,
|
||||
"required": true,
|
||||
"types": [
|
||||
{
|
||||
"type": "template_directive",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "template_else_intro",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "template_interpolation",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "template_literal",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "template_else_intro",
|
||||
"named": true,
|
||||
"fields": {},
|
||||
"children": {
|
||||
"multiple": true,
|
||||
"required": true,
|
||||
"types": [
|
||||
{
|
||||
"type": "strip_marker",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "template_directive_end",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "template_directive_start",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -837,6 +891,106 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "template_if",
|
||||
"named": true,
|
||||
"fields": {},
|
||||
"children": {
|
||||
"multiple": true,
|
||||
"required": true,
|
||||
"types": [
|
||||
{
|
||||
"type": "template_else_branch",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "template_if_branch",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "template_if_end",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "template_if_branch",
|
||||
"named": true,
|
||||
"fields": {},
|
||||
"children": {
|
||||
"multiple": true,
|
||||
"required": true,
|
||||
"types": [
|
||||
{
|
||||
"type": "template_directive",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "template_if_intro",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "template_interpolation",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "template_literal",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "template_if_end",
|
||||
"named": true,
|
||||
"fields": {},
|
||||
"children": {
|
||||
"multiple": true,
|
||||
"required": true,
|
||||
"types": [
|
||||
{
|
||||
"type": "strip_marker",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "template_directive_end",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "template_directive_start",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "template_if_intro",
|
||||
"named": true,
|
||||
"fields": {},
|
||||
"children": {
|
||||
"multiple": true,
|
||||
"required": true,
|
||||
"types": [
|
||||
{
|
||||
"type": "expression",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "strip_marker",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "template_directive_end",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "template_directive_start",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "template_interpolation",
|
||||
"named": true,
|
||||
@@ -1088,10 +1242,18 @@
|
||||
"type": "ellipsis",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "else",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "endfor",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "endif",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "false",
|
||||
"named": false
|
||||
|
||||
28008
src/parser.c
28008
src/parser.c
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user