Simplify handling of VariableInitializer (#3515)

Also stop supporting `var` with initializer inside `for`.

Resolves TODO in `handle_variable.cpp`

---------

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
Geoff Romer
2024-01-05 17:58:22 +00:00
committed by GitHub
co-authored by Richard Smith
parent a6508fcf05
commit 927d633762
70 changed files with 413 additions and 409 deletions
+3 -3
View File
@@ -21,9 +21,9 @@ var x: {.a=} = {};
// CHECK:STDOUT: {kind: 'InvalidParse', text: '=', has_error: yes},
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', has_error: yes, subtree_size: 6},
// CHECK:STDOUT: {kind: 'BindingPattern', text: ':', subtree_size: 8},
// CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2},
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2},
// CHECK:STDOUT: {kind: 'VariableInitializer', text: '=', subtree_size: 3},
// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 13},
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
// CHECK:STDOUT: ]