Change return of SkipPastLikelyEnd to be last consumed token (#3493)

This approach means the parse subtree includes the full token range
consumed.

---------

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
This commit is contained in:
josh11b
2023-12-11 22:11:09 +00:00
committed by GitHub
co-authored by Jon Ross-Perkins
parent 1addf10054
commit 6067ca3f49
28 changed files with 72 additions and 94 deletions
+5 -4
View File
@@ -56,9 +56,10 @@ fn F() {
// CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'd'},
// CHECK:STDOUT: {kind: 'IfCondition', text: ')', subtree_size: 3},
// CHECK:STDOUT: {kind: 'CodeBlockStart', text: '}', has_error: yes},
// CHECK:STDOUT: {kind: 'InvalidParse', text: '}', has_error: yes},
// CHECK:STDOUT: {kind: 'CodeBlock', text: '}', has_error: yes, subtree_size: 3},
// CHECK:STDOUT: {kind: 'IfStatement', text: 'if', subtree_size: 7},
// CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 31},
// CHECK:STDOUT: {kind: 'InvalidParse', text: '}', has_error: yes},
// CHECK:STDOUT: {kind: 'ExprStatement', text: ')', has_error: yes, subtree_size: 2},
// CHECK:STDOUT: {kind: 'CodeBlock', text: '}', has_error: yes, subtree_size: 4},
// CHECK:STDOUT: {kind: 'IfStatement', text: 'if', subtree_size: 8},
// CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 32},
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
// CHECK:STDOUT: ]