mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
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:
co-authored by
Richard Smith
parent
a6508fcf05
commit
927d633762
@@ -23,13 +23,13 @@ fn F() {
|
||||
// CHECK:STDOUT: {kind: 'IdentifierName', text: 'n'},
|
||||
// CHECK:STDOUT: {kind: 'IntTypeLiteral', text: 'i32'},
|
||||
// CHECK:STDOUT: {kind: 'BindingPattern', text: ':', subtree_size: 3},
|
||||
// CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
|
||||
// CHECK:STDOUT: {kind: 'BoolLiteralTrue', text: 'true'},
|
||||
// CHECK:STDOUT: {kind: 'IfExprIf', text: 'if', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'IntLiteral', text: '1'},
|
||||
// CHECK:STDOUT: {kind: 'IfExprThen', text: 'then', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'InvalidParse', text: ';', has_error: yes},
|
||||
// CHECK:STDOUT: {kind: 'IfExprElse', text: 'else', has_error: yes, subtree_size: 6},
|
||||
// CHECK:STDOUT: {kind: 'BoolLiteralTrue', text: 'true'},
|
||||
// CHECK:STDOUT: {kind: 'IfExprIf', text: 'if', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'IntLiteral', text: '1'},
|
||||
// CHECK:STDOUT: {kind: 'IfExprThen', text: 'then', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'InvalidParse', text: ';', has_error: yes},
|
||||
// CHECK:STDOUT: {kind: 'IfExprElse', text: 'else', has_error: yes, subtree_size: 6},
|
||||
// CHECK:STDOUT: {kind: 'VariableInitializer', text: '=', subtree_size: 7},
|
||||
// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 12},
|
||||
// CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 18},
|
||||
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
|
||||
|
||||
Reference in New Issue
Block a user