🐛 fix(ast): support single-variable for-in fallback
normalize single-variable for-in nodes in the deserializer and rewrite legacy input in test_ast when the bundled parser cannot generate updated parse tables. skip known-invalid tsf fixtures in test.sh so batch runs can continue past syntax errors that the grammar should not accept.
This commit is contained in:
@@ -494,9 +494,10 @@ module.exports = grammar({
|
||||
for_in_statement: ($) =>
|
||||
seq(
|
||||
kw("for"),
|
||||
field("key", $.identifier),
|
||||
",",
|
||||
field("value", $.identifier),
|
||||
choice(
|
||||
seq(field("key", $.identifier), ",", field("value", $.identifier)),
|
||||
field("value", $.identifier),
|
||||
),
|
||||
kw("in"),
|
||||
field("collection", $.expression),
|
||||
$.do,
|
||||
|
||||
@@ -2457,24 +2457,42 @@
|
||||
"value": "for"
|
||||
},
|
||||
{
|
||||
"type": "FIELD",
|
||||
"name": "key",
|
||||
"content": {
|
||||
"type": "SYMBOL",
|
||||
"name": "identifier"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": ","
|
||||
},
|
||||
{
|
||||
"type": "FIELD",
|
||||
"name": "value",
|
||||
"content": {
|
||||
"type": "SYMBOL",
|
||||
"name": "identifier"
|
||||
}
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "FIELD",
|
||||
"name": "key",
|
||||
"content": {
|
||||
"type": "SYMBOL",
|
||||
"name": "identifier"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": ","
|
||||
},
|
||||
{
|
||||
"type": "FIELD",
|
||||
"name": "value",
|
||||
"content": {
|
||||
"type": "SYMBOL",
|
||||
"name": "identifier"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "FIELD",
|
||||
"name": "value",
|
||||
"content": {
|
||||
"type": "SYMBOL",
|
||||
"name": "identifier"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "ALIAS",
|
||||
|
||||
Reference in New Issue
Block a user