mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 11:51:04 +01:00
Improve parsing of invalid expressions. (#2726)
This addresses crashes for infix operator expressions, but the approach should more generally yield balanced parsed trees.
This commit is contained in:
@@ -10,13 +10,14 @@
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'DesignatedName', text: 'a'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'InvalidExpression', text: '}', has_error: yes},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldUnknown', text: '=', has_error: yes},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 5},
|
||||
// CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 7},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 6},
|
||||
// CHECK:STDOUT: {kind: 'PatternBinding', 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: 'VariableDeclaration', text: ';', subtree_size: 12},
|
||||
// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 13},
|
||||
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user