Split out and/or operator handling from infix. (#3480)

This is also doing the parse node split, allowing lower reliance in
formatter on the tokenized buffer (something that I may be touching more
due to import handling).
This commit is contained in:
Jon Ross-Perkins
2023-12-09 01:03:32 +00:00
committed by GitHub
parent b7d129b88c
commit c4864aa2ff
12 changed files with 151 additions and 105 deletions
+6 -6
View File
@@ -23,19 +23,19 @@ fn F(b: bool) -> bool {
// CHECK:STDOUT: {kind: 'FunctionDefinitionStart', text: '{', subtree_size: 10},
// CHECK:STDOUT: {kind: 'ReturnStatementStart', text: 'return'},
// CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'b'},
// CHECK:STDOUT: {kind: 'ShortCircuitOperand', text: 'and', subtree_size: 2},
// CHECK:STDOUT: {kind: 'ShortCircuitOperandAnd', text: 'and', subtree_size: 2},
// CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'b'},
// CHECK:STDOUT: {kind: 'InfixOperator', text: 'and', subtree_size: 4},
// CHECK:STDOUT: {kind: 'ShortCircuitOperatorAnd', text: 'and', subtree_size: 4},
// CHECK:STDOUT: {kind: 'IfExprIf', text: 'if', subtree_size: 5},
// CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'b'},
// CHECK:STDOUT: {kind: 'ShortCircuitOperand', text: 'and', subtree_size: 2},
// CHECK:STDOUT: {kind: 'ShortCircuitOperandAnd', text: 'and', subtree_size: 2},
// CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'b'},
// CHECK:STDOUT: {kind: 'InfixOperator', text: 'and', subtree_size: 4},
// CHECK:STDOUT: {kind: 'ShortCircuitOperatorAnd', text: 'and', subtree_size: 4},
// CHECK:STDOUT: {kind: 'IfExprThen', text: 'then', subtree_size: 5},
// CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'b'},
// CHECK:STDOUT: {kind: 'ShortCircuitOperand', text: 'or', subtree_size: 2},
// CHECK:STDOUT: {kind: 'ShortCircuitOperandOr', text: 'or', subtree_size: 2},
// CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'b'},
// CHECK:STDOUT: {kind: 'InfixOperator', text: 'or', subtree_size: 4},
// CHECK:STDOUT: {kind: 'ShortCircuitOperatorOr', text: 'or', subtree_size: 4},
// CHECK:STDOUT: {kind: 'IfExprElse', text: 'else', subtree_size: 15},
// CHECK:STDOUT: {kind: 'ReturnStatement', text: ';', subtree_size: 17},
// CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 28},