Use more specific node kinds for literals. (#3419)

Sounding out the approach, to make it clearer what a literal node
corresponds to.
This commit is contained in:
Jon Ross-Perkins
2023-11-22 01:27:28 +00:00
committed by GitHub
parent f1ddded3a1
commit a204689893
107 changed files with 463 additions and 383 deletions
+3 -3
View File
@@ -29,7 +29,7 @@ class Foo {
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
// CHECK:STDOUT: {kind: 'Name', text: 'x'},
// CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
// CHECK:STDOUT: {kind: 'Literal', text: '0'},
// CHECK:STDOUT: {kind: 'IntegerLiteral', text: '0'},
// CHECK:STDOUT: {kind: 'StructFieldValue', text: '=', subtree_size: 4},
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 6},
// CHECK:STDOUT: {kind: 'ReturnStatement', text: ';', subtree_size: 8},
@@ -43,7 +43,7 @@ class Foo {
// CHECK:STDOUT: {kind: 'ImplicitParamList', text: ']', subtree_size: 5},
// CHECK:STDOUT: {kind: 'ParamListStart', text: '('},
// CHECK:STDOUT: {kind: 'ParamList', text: ')', subtree_size: 2},
// CHECK:STDOUT: {kind: 'Literal', text: 'i32'},
// CHECK:STDOUT: {kind: 'IntegerTypeLiteral', text: 'i32'},
// CHECK:STDOUT: {kind: 'ReturnType', text: '->', subtree_size: 2},
// CHECK:STDOUT: {kind: 'FunctionDefinitionStart', text: '{', subtree_size: 12},
// CHECK:STDOUT: {kind: 'ReturnStatementStart', text: 'return'},
@@ -67,7 +67,7 @@ class Foo {
// CHECK:STDOUT: {kind: 'SelfValueNameExpr', text: 'self'},
// CHECK:STDOUT: {kind: 'Name', text: 'x'},
// CHECK:STDOUT: {kind: 'PointerMemberAccessExpr', text: '->', subtree_size: 3},
// CHECK:STDOUT: {kind: 'Literal', text: '1'},
// CHECK:STDOUT: {kind: 'IntegerLiteral', text: '1'},
// CHECK:STDOUT: {kind: 'InfixOperator', text: '=', subtree_size: 5},
// CHECK:STDOUT: {kind: 'ExprStatement', text: ';', subtree_size: 6},
// CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 19},
+1 -1
View File
@@ -16,7 +16,7 @@ class Foo {
// CHECK:STDOUT: {kind: 'ClassDefinitionStart', text: '{', subtree_size: 3},
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
// CHECK:STDOUT: {kind: 'Name', text: 'x'},
// CHECK:STDOUT: {kind: 'Literal', text: 'i32'},
// CHECK:STDOUT: {kind: 'IntegerTypeLiteral', text: 'i32'},
// CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3},
// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 5},
// CHECK:STDOUT: {kind: 'ClassDefinition', text: '}', subtree_size: 9},