Change tuple/paren expr parsing to use placeholders. (#3849)

I've been thinking about this since we decided to add placeholders in
the parse tree. This allows a clearer division of work in check
handling, where we were doing work for ExprOpenParen that's only
necessary for tuples (splitting/renaming handle_paren.cpp accordingly).
This commit is contained in:
Jon Ross-Perkins
2024-04-03 18:31:16 +00:00
committed by GitHub
parent 5c567b892d
commit b42612bcec
21 changed files with 80 additions and 63 deletions
+2 -2
View File
@@ -30,7 +30,7 @@ fn C() -> const (i32*) { return C(); }
// CHECK:STDOUT: {kind: 'IdentifierName', text: 'B'},
// CHECK:STDOUT: {kind: 'TuplePatternStart', text: '('},
// CHECK:STDOUT: {kind: 'TuplePattern', text: ')', subtree_size: 2},
// CHECK:STDOUT: {kind: 'ExprOpenParen', text: '('},
// CHECK:STDOUT: {kind: 'ParenExprStart', text: '('},
// CHECK:STDOUT: {kind: 'IntTypeLiteral', text: 'i32'},
// CHECK:STDOUT: {kind: 'PrefixOperatorConst', text: 'const', subtree_size: 2},
// CHECK:STDOUT: {kind: 'ParenExpr', text: ')', subtree_size: 4},
@@ -47,7 +47,7 @@ fn C() -> const (i32*) { return C(); }
// CHECK:STDOUT: {kind: 'IdentifierName', text: 'C'},
// CHECK:STDOUT: {kind: 'TuplePatternStart', text: '('},
// CHECK:STDOUT: {kind: 'TuplePattern', text: ')', subtree_size: 2},
// CHECK:STDOUT: {kind: 'ExprOpenParen', text: '('},
// CHECK:STDOUT: {kind: 'ParenExprStart', text: '('},
// CHECK:STDOUT: {kind: 'IntTypeLiteral', text: 'i32'},
// CHECK:STDOUT: {kind: 'PostfixOperatorStar', text: '*', subtree_size: 2},
// CHECK:STDOUT: {kind: 'ParenExpr', text: ')', subtree_size: 4},