diff --git a/CodeGeneration/Sources/SyntaxSupport/AttributeNodes.swift b/CodeGeneration/Sources/SyntaxSupport/AttributeNodes.swift index b7a9dbe5bea..b2957c3a83a 100644 --- a/CodeGeneration/Sources/SyntaxSupport/AttributeNodes.swift +++ b/CodeGeneration/Sources/SyntaxSupport/AttributeNodes.swift @@ -13,7 +13,6 @@ public let ATTRIBUTE_NODES: [Node] = [ Node( kind: .attributeList, - base: .syntaxCollection, nameForDiagnostics: "attributes", documentation: """ A list of attributes that can be attached to a declaration. @@ -34,7 +33,6 @@ public let ATTRIBUTE_NODES: [Node] = [ Node( kind: .attribute, - base: .syntax, nameForDiagnostics: "attribute", documentation: "An `@` attribute.", parserFunction: "parseAttribute", @@ -161,7 +159,6 @@ public let ATTRIBUTE_NODES: [Node] = [ Node( kind: .specializeAvailabilityArgument, - base: .syntax, nameForDiagnostics: "availability entry", documentation: "The availability argument for the _specialize attribute", children: [ @@ -195,7 +192,6 @@ public let ATTRIBUTE_NODES: [Node] = [ Node( kind: .platformVersionItem, - base: .syntax, nameForDiagnostics: "version", documentation: "A single platform/version pair in an attribute, e.g. `iOS 10.1`.", traits: ["WithTrailingComma"], @@ -217,14 +213,12 @@ public let ATTRIBUTE_NODES: [Node] = [ Node( kind: .platformVersionItemList, - base: .syntaxCollection, nameForDiagnostics: "version list", elementChoices: [.platformVersionItem] ), Node( kind: .backDeployedAttributeArguments, - base: .syntax, nameForDiagnostics: "'@backDeployed' arguments", documentation: "A collection of arguments for the `@backDeployed` attribute", children: [ @@ -253,7 +247,6 @@ public let ATTRIBUTE_NODES: [Node] = [ Node( kind: .conventionAttributeArguments, - base: .syntax, nameForDiagnostics: "@convention(...) arguments", documentation: "The arguments for the '@convention(...)'.", children: [ @@ -287,7 +280,6 @@ public let ATTRIBUTE_NODES: [Node] = [ Node( kind: .conventionWitnessMethodAttributeArguments, - base: .syntax, nameForDiagnostics: "@convention(...) arguments for witness methods", documentation: "The arguments for the '@convention(witness_method: ...)'.", children: [ @@ -312,7 +304,6 @@ public let ATTRIBUTE_NODES: [Node] = [ Node( kind: .derivativeAttributeArguments, - base: .syntax, nameForDiagnostics: "attribute arguments", documentation: "The arguments for the '@derivative(of:)' and '@transpose(of:)' attributes: the 'of:' label, the original declaration name, and an optional differentiability parameter list.", @@ -361,14 +352,12 @@ public let ATTRIBUTE_NODES: [Node] = [ Node( kind: .differentiabilityArgumentList, - base: .syntaxCollection, nameForDiagnostics: "differentiability parameters", elementChoices: [.differentiabilityArgument] ), Node( kind: .differentiabilityArgument, - base: .syntax, nameForDiagnostics: "differentiability argument", documentation: "A differentiability argument: either the \"self\" identifier, a function parameter name, or a function parameter index.", @@ -391,7 +380,6 @@ public let ATTRIBUTE_NODES: [Node] = [ Node( kind: .differentiabilityWithRespectToArgument, - base: .syntax, nameForDiagnostics: "'@differentiable' argument", documentation: "A clause containing differentiability parameters.", children: [ @@ -427,7 +415,6 @@ public let ATTRIBUTE_NODES: [Node] = [ Node( kind: .differentiabilityArguments, - base: .syntax, nameForDiagnostics: "differentiability arguments", documentation: "The differentiability arguments.", children: [ @@ -450,7 +437,6 @@ public let ATTRIBUTE_NODES: [Node] = [ Node( kind: .differentiableAttributeArguments, - base: .syntax, nameForDiagnostics: "'@differentiable' arguments", documentation: "The arguments for the `@differentiable` attribute: an optional differentiability kind, an optional differentiability parameter clause, and an optional 'where' clause.", @@ -496,7 +482,6 @@ public let ATTRIBUTE_NODES: [Node] = [ Node( kind: .documentationAttributeArgument, - base: .syntax, nameForDiagnostics: "@_documentation argument", traits: [ "WithTrailingComma" @@ -542,7 +527,6 @@ public let ATTRIBUTE_NODES: [Node] = [ Node( kind: .documentationAttributeArgumentList, - base: .syntaxCollection, nameForDiagnostics: "@_documentation arguments", documentation: "The arguments of the '@_documentation' attribute", elementChoices: [.documentationAttributeArgument] @@ -550,7 +534,6 @@ public let ATTRIBUTE_NODES: [Node] = [ Node( kind: .dynamicReplacementAttributeArguments, - base: .syntax, nameForDiagnostics: "@_dynamicReplacement argument", documentation: "The arguments for the '@_dynamicReplacement' attribute", children: [ @@ -572,7 +555,6 @@ public let ATTRIBUTE_NODES: [Node] = [ Node( kind: .effectsAttributeArgumentList, - base: .syntaxCollection, nameForDiagnostics: "@_effects arguments", documentation: "The arguments of the '@_effects' attribute. These will be parsed during the SIL stage.", elementChoices: [.token] @@ -580,7 +562,6 @@ public let ATTRIBUTE_NODES: [Node] = [ Node( kind: .exposeAttributeArguments, - base: .syntax, nameForDiagnostics: "@_expose arguments", documentation: "The arguments for the '@_expose' attribute", children: [ @@ -603,7 +584,6 @@ public let ATTRIBUTE_NODES: [Node] = [ Node( kind: .implementsAttributeArguments, - base: .syntax, nameForDiagnostics: "@_implements arguemnts", documentation: "The arguments for the `@_implements` attribute of the form `Type, methodName(arg1Label:arg2Label:)`", @@ -631,7 +611,6 @@ public let ATTRIBUTE_NODES: [Node] = [ Node( kind: .labeledSpecializeArgument, - base: .syntax, nameForDiagnostics: "attribute argument", documentation: "A labeled argument for the `@_specialize` attribute like `exported: true`", traits: [ @@ -673,7 +652,6 @@ public let ATTRIBUTE_NODES: [Node] = [ Node( kind: .objCSelectorPiece, - base: .syntax, nameForDiagnostics: "Objective-C selector piece", documentation: "A piece of an Objective-C selector. Either consisting of just an identifier for a nullary selector, an identifier and a colon for a labeled argument or just a colon for an unlabeled argument", @@ -696,14 +674,12 @@ public let ATTRIBUTE_NODES: [Node] = [ Node( kind: .objCSelectorPieceList, - base: .syntaxCollection, nameForDiagnostics: "Objective-C selector", elementChoices: [.objCSelectorPiece] ), Node( kind: .opaqueReturnTypeOfAttributeArguments, - base: .syntax, nameForDiagnostics: "opaque return type arguments", documentation: "The arguments for the '@_opaqueReturnTypeOf()'.", children: [ @@ -726,7 +702,6 @@ public let ATTRIBUTE_NODES: [Node] = [ Node( kind: .originallyDefinedInAttributeArguments, - base: .syntax, nameForDiagnostics: "@_originallyDefinedIn arguments", documentation: "The arguments for the '@_originallyDefinedIn' attribute", children: [ @@ -755,7 +730,6 @@ public let ATTRIBUTE_NODES: [Node] = [ Node( kind: .specializeAttributeArgumentList, - base: .syntaxCollection, nameForDiagnostics: "argument to '@_specialize", documentation: "A collection of arguments for the `@_specialize` attribute", elementChoices: [ @@ -766,7 +740,6 @@ public let ATTRIBUTE_NODES: [Node] = [ Node( kind: .specializeTargetFunctionArgument, - base: .syntax, nameForDiagnostics: "attribute argument", documentation: "A labeled argument for the `@_specialize` attribute with a function decl value like `target: myFunc(_:)`", @@ -804,7 +777,6 @@ public let ATTRIBUTE_NODES: [Node] = [ Node( kind: .unavailableFromAsyncAttributeArguments, - base: .syntax, nameForDiagnostics: "@_unavailableFromAsync argument", documentation: "The arguments for the '@_unavailableFromAsync' attribute", children: [ @@ -825,7 +797,6 @@ public let ATTRIBUTE_NODES: [Node] = [ Node( kind: .underscorePrivateAttributeArguments, - base: .syntax, nameForDiagnostics: "@_private argument", documentation: "The arguments for the '@_private' attribute", children: [ diff --git a/CodeGeneration/Sources/SyntaxSupport/AvailabilityNodes.swift b/CodeGeneration/Sources/SyntaxSupport/AvailabilityNodes.swift index f7d12324a79..d787b8761f7 100644 --- a/CodeGeneration/Sources/SyntaxSupport/AvailabilityNodes.swift +++ b/CodeGeneration/Sources/SyntaxSupport/AvailabilityNodes.swift @@ -13,7 +13,6 @@ public let AVAILABILITY_NODES: [Node] = [ Node( kind: .availabilityArgument, - base: .syntax, nameForDiagnostics: "availability argument", documentation: "A single argument to an `@available` argument like `*`, `iOS 10.1`, or `message: \"This has been deprecated\"`.", @@ -53,7 +52,6 @@ public let AVAILABILITY_NODES: [Node] = [ Node( kind: .availabilityLabeledArgument, - base: .syntax, nameForDiagnostics: "availability argument", documentation: "An argument to an `@available` attribute that consists of a label and a value, e.g. `message: \"This has been deprecated\"`.", @@ -95,14 +93,12 @@ public let AVAILABILITY_NODES: [Node] = [ Node( kind: .availabilityArgumentList, - base: .syntaxCollection, nameForDiagnostics: "'@availability' arguments", elementChoices: [.availabilityArgument] ), Node( kind: .platformVersion, - base: .syntax, nameForDiagnostics: "version restriction", documentation: "An argument to `@available` that restricts the availability on a certain platform to a version, e.g. `iOS 10` or `swift 3.4`.", @@ -132,7 +128,6 @@ public let AVAILABILITY_NODES: [Node] = [ Node( kind: .versionComponent, - base: .syntax, nameForDiagnostics: nil, documentation: "An element to represent a single component in a version, like `.1`.", children: [ @@ -151,14 +146,12 @@ public let AVAILABILITY_NODES: [Node] = [ Node( kind: .versionComponentList, - base: .syntaxCollection, nameForDiagnostics: nil, elementChoices: [.versionComponent] ), Node( kind: .versionTuple, - base: .syntax, nameForDiagnostics: "version tuple", documentation: "A version number like `1.2.0`. Only the first version component is required. There might be an arbitrary number of following components.", diff --git a/CodeGeneration/Sources/SyntaxSupport/CommonNodes.swift b/CodeGeneration/Sources/SyntaxSupport/CommonNodes.swift index 7247e17a909..00046d57019 100644 --- a/CodeGeneration/Sources/SyntaxSupport/CommonNodes.swift +++ b/CodeGeneration/Sources/SyntaxSupport/CommonNodes.swift @@ -13,14 +13,12 @@ public let COMMON_NODES: [Node] = [ Node( kind: .codeBlockItemList, - base: .syntaxCollection, nameForDiagnostics: nil, elementChoices: [.codeBlockItem] ), Node( kind: .codeBlockItem, - base: .syntax, nameForDiagnostics: nil, documentation: "A CodeBlockItem is any Syntax node that appears on its own line inside a CodeBlock.", parserFunction: "parseNonOptionalCodeBlockItem", @@ -54,7 +52,6 @@ public let COMMON_NODES: [Node] = [ Node( kind: .codeBlock, - base: .syntax, nameForDiagnostics: "code block", parserFunction: "parseCodeBlock", traits: [ @@ -82,7 +79,6 @@ public let COMMON_NODES: [Node] = [ Node( kind: .throwsClause, - base: .syntax, nameForDiagnostics: "throws clause", children: [ Child( @@ -114,7 +110,6 @@ public let COMMON_NODES: [Node] = [ Node( kind: .accessorEffectSpecifiers, - base: .syntax, nameForDiagnostics: "accessor specifiers", traits: [ "EffectSpecifiers" @@ -137,7 +132,6 @@ public let COMMON_NODES: [Node] = [ Node( kind: .functionEffectSpecifiers, - base: .syntax, nameForDiagnostics: "effect specifiers", traits: [ "EffectSpecifiers" @@ -160,7 +154,6 @@ public let COMMON_NODES: [Node] = [ Node( kind: .deinitializerEffectSpecifiers, - base: .syntax, nameForDiagnostics: "effect specifiers", traits: [], children: [ @@ -175,21 +168,18 @@ public let COMMON_NODES: [Node] = [ Node( kind: .decl, - base: .syntax, nameForDiagnostics: "declaration", parserFunction: "parseDeclaration" ), Node( kind: .expr, - base: .syntax, nameForDiagnostics: "expression", parserFunction: "parseExpression" ), Node( kind: .missingDecl, - base: .decl, nameForDiagnostics: "declaration", documentation: "In case the source code is missing a declaration, this node stands in place of the missing declaration.", @@ -225,7 +215,6 @@ public let COMMON_NODES: [Node] = [ Node( kind: .missingExpr, - base: .expr, nameForDiagnostics: "expression", documentation: "In case the source code is missing an expression, this node stands in place of the missing expression.", @@ -247,7 +236,6 @@ public let COMMON_NODES: [Node] = [ Node( kind: .missingPattern, - base: .pattern, nameForDiagnostics: "pattern", documentation: "In case the source code is missing a pattern, this node stands in place of the missing pattern.", traits: [ @@ -268,7 +256,6 @@ public let COMMON_NODES: [Node] = [ Node( kind: .missingStmt, - base: .stmt, nameForDiagnostics: "statement", documentation: "In case the source code is missing a statement, this node stands in place of the missing statement.", @@ -290,7 +277,6 @@ public let COMMON_NODES: [Node] = [ Node( kind: .missing, - base: .syntax, nameForDiagnostics: nil, documentation: "In case the source code is missing a syntax node, this node stands in place of the missing node.", traits: [ @@ -311,7 +297,6 @@ public let COMMON_NODES: [Node] = [ Node( kind: .missingType, - base: .type, nameForDiagnostics: "type", documentation: "In case the source code is missing a type, this node stands in place of the missing type.", traits: [ @@ -332,21 +317,18 @@ public let COMMON_NODES: [Node] = [ Node( kind: .pattern, - base: .syntax, nameForDiagnostics: "pattern", parserFunction: "parsePattern" ), Node( kind: .stmt, - base: .syntax, nameForDiagnostics: "statement", parserFunction: "parseStatement" ), Node( kind: .typeEffectSpecifiers, - base: .syntax, nameForDiagnostics: "effect specifiers", traits: [ "EffectSpecifiers" @@ -368,14 +350,12 @@ public let COMMON_NODES: [Node] = [ Node( kind: .type, - base: .syntax, nameForDiagnostics: "type", parserFunction: "parseType" ), Node( kind: .unexpectedNodes, - base: .syntaxCollection, nameForDiagnostics: nil, documentation: "A collection of syntax nodes that occurred in the source code but could not be used to form a valid syntax tree.", diff --git a/CodeGeneration/Sources/SyntaxSupport/DeclNodes.swift b/CodeGeneration/Sources/SyntaxSupport/DeclNodes.swift index 53f430923fe..73485630746 100644 --- a/CodeGeneration/Sources/SyntaxSupport/DeclNodes.swift +++ b/CodeGeneration/Sources/SyntaxSupport/DeclNodes.swift @@ -13,7 +13,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .importPathComponent, - base: .syntax, nameForDiagnostics: nil, children: [ Child( @@ -37,14 +36,12 @@ public let DECL_NODES: [Node] = [ Node( kind: .importPathComponentList, - base: .syntaxCollection, nameForDiagnostics: nil, elementChoices: [.importPathComponent] ), Node( kind: .accessorBlock, - base: .syntax, nameForDiagnostics: nil, parserFunction: "parseAccessorBlock", traits: [ @@ -79,7 +76,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .accessorDecl, - base: .decl, nameForDiagnostics: "accessor", parserFunction: "parseAccessorDecl", traits: [ @@ -139,14 +135,12 @@ public let DECL_NODES: [Node] = [ Node( kind: .accessorDeclList, - base: .syntaxCollection, nameForDiagnostics: nil, elementChoices: [.accessorDecl] ), Node( kind: .accessorParameters, - base: .syntax, nameForDiagnostics: nil, traits: [ "Parenthesized" @@ -170,7 +164,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .actorDecl, - base: .decl, nameForDiagnostics: "actor", traits: [ "DeclGroup", @@ -232,7 +225,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .associatedTypeDecl, - base: .decl, nameForDiagnostics: "associatedtype declaration", documentation: """ An `associatedtype` declaration @@ -316,7 +308,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .classDecl, - base: .decl, nameForDiagnostics: "class", documentation: """ A `class` declaration @@ -406,7 +397,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .declModifierDetail, - base: .syntax, nameForDiagnostics: nil, traits: [ "Parenthesized" @@ -429,7 +419,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .declModifier, - base: .syntax, nameForDiagnostics: "modifier", children: [ Child( @@ -483,7 +472,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .deinitializerDecl, - base: .decl, nameForDiagnostics: "deinitializer", documentation: """ A `deint` declaration @@ -534,7 +522,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .designatedType, - base: .syntax, nameForDiagnostics: nil, children: [ Child( @@ -550,14 +537,12 @@ public let DECL_NODES: [Node] = [ Node( kind: .designatedTypeList, - base: .syntaxCollection, nameForDiagnostics: nil, elementChoices: [.designatedType] ), Node( kind: .editorPlaceholderDecl, - base: .decl, nameForDiagnostics: "editor placeholder", documentation: """ An editor placeholder, e.g. `<#declaration#>` that is used in a position that expects a declaration. @@ -594,7 +579,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .enumCaseParameterClause, - base: .syntax, nameForDiagnostics: "parameter clause", traits: [ "Parenthesized" @@ -622,14 +606,12 @@ public let DECL_NODES: [Node] = [ Node( kind: .enumCaseParameterList, - base: .syntaxCollection, nameForDiagnostics: "parameter list", elementChoices: [.enumCaseParameter] ), Node( kind: .enumCaseParameter, - base: .syntax, nameForDiagnostics: "parameter", parserFunction: "parseEnumCaseParameter", traits: ["WithTrailingComma", "WithModifiers"], @@ -680,7 +662,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .enumCaseDecl, - base: .decl, nameForDiagnostics: "enum case", documentation: "A `case` declaration of a Swift `enum`. It can have 1 or more `EnumCaseElement`s inside, each declaring a different case of the enum.", @@ -717,7 +698,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .enumCaseElementList, - base: .syntaxCollection, nameForDiagnostics: nil, documentation: "A collection of 0 or more ``EnumCaseElementSyntax``s.", elementChoices: [.enumCaseElement] @@ -725,7 +705,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .enumCaseElement, - base: .syntax, nameForDiagnostics: nil, documentation: "An element of an enum case, containing the name of the case and, optionally, either associated values or an assignment to a raw value.", @@ -764,7 +743,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .enumDecl, - base: .decl, nameForDiagnostics: "enum", documentation: "A Swift `enum` declaration.", traits: [ @@ -832,7 +810,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .extensionDecl, - base: .decl, nameForDiagnostics: "extension", documentation: """ An `extension` declaration. @@ -911,7 +888,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .functionDecl, - base: .decl, nameForDiagnostics: "function", documentation: """ A Swift `func` declaration. @@ -1004,7 +980,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .functionParameterList, - base: .syntaxCollection, nameForDiagnostics: "parameter list", documentation: """ A list of function parameters that are type annotated and a label. @@ -1023,7 +998,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .functionParameter, - base: .syntax, nameForDiagnostics: "parameter", documentation: "A function parameter", parserFunction: "parseFunctionParameter", @@ -1090,7 +1064,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .functionSignature, - base: .syntax, nameForDiagnostics: "function signature", documentation: "A function signature that defines the interface of the function.", children: [ @@ -1118,14 +1091,12 @@ public let DECL_NODES: [Node] = [ Node( kind: .ifConfigClauseList, - base: .syntaxCollection, nameForDiagnostics: nil, elementChoices: [.ifConfigClause] ), Node( kind: .ifConfigClause, - base: .syntax, nameForDiagnostics: "conditional compilation clause", children: [ Child( @@ -1169,7 +1140,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .ifConfigDecl, - base: .decl, nameForDiagnostics: "conditional compilation block", children: [ Child( @@ -1185,7 +1155,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .importDecl, - base: .decl, nameForDiagnostics: "import", documentation: """ An `import` declaration @@ -1251,14 +1220,12 @@ public let DECL_NODES: [Node] = [ Node( kind: .inheritedTypeList, - base: .syntaxCollection, nameForDiagnostics: nil, elementChoices: [.inheritedType] ), Node( kind: .inheritedType, - base: .syntax, nameForDiagnostics: "inherited type", traits: [ "WithTrailingComma" @@ -1279,7 +1246,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .initializerClause, - base: .syntax, nameForDiagnostics: nil, children: [ Child( @@ -1295,7 +1261,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .initializerDecl, - base: .decl, nameForDiagnostics: "initializer", documentation: """ An `init` declaration @@ -1374,7 +1339,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .macroDecl, - base: .decl, nameForDiagnostics: "macro", traits: [ "NamedDecl", @@ -1433,7 +1397,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .macroExpansionDecl, - base: .decl, nameForDiagnostics: "macro expansion", documentation: "The expansion of a freestanding macro in a position that expects a declaration.", traits: [ @@ -1502,7 +1465,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .memberBlock, - base: .syntax, nameForDiagnostics: "member block", parserFunction: "parseMemberBlock", traits: ["Braced"], @@ -1524,7 +1486,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .memberBlockItem, - base: .syntax, nameForDiagnostics: nil, documentation: "A member declaration of a type consisting of a declaration and an optional semicolon;", children: [ @@ -1544,21 +1505,18 @@ public let DECL_NODES: [Node] = [ Node( kind: .memberBlockItemList, - base: .syntaxCollection, nameForDiagnostics: nil, elementChoices: [.memberBlockItem] ), Node( kind: .declModifierList, - base: .syntaxCollection, nameForDiagnostics: nil, elementChoices: [.declModifier] ), Node( kind: .operatorDecl, - base: .decl, nameForDiagnostics: "operator declaration", documentation: "A Swift `operator` declaration.", traits: [ @@ -1592,7 +1550,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .operatorPrecedenceAndTypes, - base: .syntax, nameForDiagnostics: nil, documentation: "A clause to specify precedence group in infix operator declarations, and designated types in any operator declaration.", @@ -1617,7 +1574,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .functionParameterClause, - base: .syntax, nameForDiagnostics: "parameter clause", traits: [ "Parenthesized" @@ -1642,14 +1598,12 @@ public let DECL_NODES: [Node] = [ Node( kind: .patternBindingList, - base: .syntaxCollection, nameForDiagnostics: nil, elementChoices: [.patternBinding] ), Node( kind: .patternBinding, - base: .syntax, nameForDiagnostics: nil, documentation: """ Defines variables inside a variable declaration. @@ -1713,7 +1667,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .poundSourceLocationArguments, - base: .syntax, nameForDiagnostics: "'#sourceLocation' arguments", children: [ Child( @@ -1755,7 +1708,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .poundSourceLocation, - base: .decl, nameForDiagnostics: "'#sourceLocation' directive", traits: [ "Parenthesized" @@ -1785,7 +1737,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .precedenceGroupAssignment, - base: .syntax, nameForDiagnostics: "'assignment' property of precedencegroup", documentation: "Specifies the precedence of an operator when used in an operation that includes optional chaining.", children: [ @@ -1810,7 +1761,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .precedenceGroupAssociativity, - base: .syntax, nameForDiagnostics: "'associativity' property of precedencegroup", documentation: "Specifies how a sequence of operators with the same precedence level are grouped together in the absence of grouping parentheses.", @@ -1834,14 +1784,12 @@ public let DECL_NODES: [Node] = [ ), Node( kind: .precedenceGroupAttributeList, - base: .syntaxCollection, nameForDiagnostics: nil, elementChoices: [.precedenceGroupRelation, .precedenceGroupAssignment, .precedenceGroupAssociativity] ), Node( kind: .precedenceGroupDecl, - base: .decl, nameForDiagnostics: "precedencegroup", documentation: "A Swift `precedencegroup` declaration.", traits: [ @@ -1891,7 +1839,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .precedenceGroupName, - base: .syntax, nameForDiagnostics: nil, traits: ["WithTrailingComma"], children: [ @@ -1910,14 +1857,12 @@ public let DECL_NODES: [Node] = [ Node( kind: .precedenceGroupNameList, - base: .syntaxCollection, nameForDiagnostics: nil, elementChoices: [.precedenceGroupName] ), Node( kind: .precedenceGroupRelation, - base: .syntax, nameForDiagnostics: "'relation' property of precedencegroup", documentation: "Specify the new precedence group's relation to existing precedence groups.", children: [ @@ -1942,7 +1887,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .protocolDecl, - base: .decl, nameForDiagnostics: "protocol", documentation: """ A `protocol` declaration @@ -2016,7 +1960,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .returnClause, - base: .syntax, nameForDiagnostics: nil, children: [ Child( @@ -2036,7 +1979,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .sourceFile, - base: .syntax, nameForDiagnostics: "source file", parserFunction: "parseSourceFile", traits: ["WithStatements"], @@ -2061,7 +2003,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .structDecl, - base: .decl, nameForDiagnostics: "struct", documentation: """ A `struct` declaration @@ -2187,7 +2128,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .subscriptDecl, - base: .decl, nameForDiagnostics: "subscript", traits: [ "WithAttributes", @@ -2245,7 +2185,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .inheritanceClause, - base: .syntax, nameForDiagnostics: "inheritance clause", children: [ Child( @@ -2262,7 +2201,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .typeInitializerClause, - base: .syntax, nameForDiagnostics: nil, children: [ Child( @@ -2279,7 +2217,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .typeAliasDecl, - base: .decl, nameForDiagnostics: "typealias declaration", traits: [ "NamedDecl", @@ -2331,7 +2268,6 @@ public let DECL_NODES: [Node] = [ Node( kind: .variableDecl, - base: .decl, nameForDiagnostics: "variable", documentation: """ Declaration of one or more variables diff --git a/CodeGeneration/Sources/SyntaxSupport/ExprNodes.swift b/CodeGeneration/Sources/SyntaxSupport/ExprNodes.swift index c642bf81efb..6497aa0a3e6 100644 --- a/CodeGeneration/Sources/SyntaxSupport/ExprNodes.swift +++ b/CodeGeneration/Sources/SyntaxSupport/ExprNodes.swift @@ -13,14 +13,12 @@ public let EXPR_NODES: [Node] = [ Node( kind: .arrayElementList, - base: .syntaxCollection, nameForDiagnostics: nil, elementChoices: [.arrayElement] ), Node( kind: .arrayElement, - base: .syntax, nameForDiagnostics: "array element", documentation: "An element inside an array literal.", traits: [ @@ -42,7 +40,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .arrayExpr, - base: .expr, nameForDiagnostics: "array", documentation: "An array literal.", children: [ @@ -65,7 +62,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .arrowExpr, - base: .expr, nameForDiagnostics: nil, documentation: """ The arrow when a type is used at a position that syntactically expectes an expression. @@ -94,7 +90,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .asExpr, - base: .expr, nameForDiagnostics: "'as'", documentation: """ The cast of an expressison to a different type. @@ -137,7 +132,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .assignmentExpr, - base: .expr, nameForDiagnostics: nil, children: [ Child( @@ -150,7 +144,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .awaitExpr, - base: .expr, nameForDiagnostics: "'await' expression", children: [ Child( @@ -166,7 +159,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .binaryOperatorExpr, - base: .expr, nameForDiagnostics: "operator", documentation: """ An operator like `+` or `-`. @@ -186,7 +178,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .booleanLiteralExpr, - base: .expr, nameForDiagnostics: "bool literal", children: [ Child( @@ -199,7 +190,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .borrowExpr, - base: .expr, nameForDiagnostics: "'_borrow' expression", children: [ Child( @@ -215,7 +205,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: ._canImportExpr, - base: .expr, nameForDiagnostics: "'canImport' expression", children: [ Child( @@ -244,7 +233,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: ._canImportVersionInfo, - base: .expr, nameForDiagnostics: nil, children: [ Child( @@ -269,7 +257,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .switchCaseItem, - base: .syntax, nameForDiagnostics: nil, traits: [ "WithTrailingComma" @@ -294,14 +281,12 @@ public let EXPR_NODES: [Node] = [ Node( kind: .closureCaptureList, - base: .syntaxCollection, nameForDiagnostics: nil, elementChoices: [.closureCapture] ), Node( kind: .closureCaptureSpecifier, - base: .syntax, nameForDiagnostics: "closure capture specifier", children: [ Child( @@ -328,7 +313,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .closureCapture, - base: .syntax, nameForDiagnostics: "closure capture", traits: [ "WithTrailingComma" @@ -358,7 +342,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .closureCaptureClause, - base: .syntax, nameForDiagnostics: "closure capture clause", children: [ Child( @@ -378,7 +361,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .closureParameter, - base: .syntax, nameForDiagnostics: "parameter", parserFunction: "parseClosureParameter", traits: ["WithTrailingComma", "WithAttributes", "WithModifiers"], @@ -435,14 +417,12 @@ public let EXPR_NODES: [Node] = [ Node( kind: .closureParameterList, - base: .syntaxCollection, nameForDiagnostics: "parameter list", elementChoices: [.closureParameter] ), Node( kind: .closureParameterClause, - base: .syntax, nameForDiagnostics: "parameter clause", traits: [ "Parenthesized" @@ -470,7 +450,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .closureExpr, - base: .expr, nameForDiagnostics: "closure", traits: [ "Braced", @@ -499,7 +478,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .closureShorthandParameterList, - base: .syntaxCollection, nameForDiagnostics: nil, documentation: """ A list of closure parameters that are not parenthesized and don't have type annotations. @@ -520,7 +498,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .closureShorthandParameter, - base: .syntax, nameForDiagnostics: "closure parameter", traits: [ "WithTrailingComma" @@ -541,7 +518,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .closureSignature, - base: .syntax, nameForDiagnostics: "closure signature", traits: [ "WithAttributes" @@ -594,14 +570,12 @@ public let EXPR_NODES: [Node] = [ Node( kind: .declNameArgumentList, - base: .syntaxCollection, nameForDiagnostics: nil, elementChoices: [.declNameArgument] ), Node( kind: .declNameArgument, - base: .syntax, nameForDiagnostics: nil, children: [ Child( @@ -617,7 +591,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .declNameArguments, - base: .syntax, nameForDiagnostics: nil, traits: [ "Parenthesized" @@ -640,14 +613,12 @@ public let EXPR_NODES: [Node] = [ Node( kind: .dictionaryElementList, - base: .syntaxCollection, nameForDiagnostics: nil, elementChoices: [.dictionaryElement] ), Node( kind: .dictionaryElement, - base: .syntax, nameForDiagnostics: "dictionary element", documentation: "An element inside a dictionary literal.", traits: [ @@ -680,7 +651,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .dictionaryExpr, - base: .expr, nameForDiagnostics: "dictionary", documentation: "A dictionary literal", children: [ @@ -710,7 +680,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .discardAssignmentExpr, - base: .expr, nameForDiagnostics: nil, documentation: """ A `_` that discards a value inside an assignment. @@ -736,7 +705,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .doExpr, - base: .expr, experimentalFeature: .doExpressions, nameForDiagnostics: "'do' block", documentation: """ @@ -784,7 +752,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .editorPlaceholderExpr, - base: .expr, nameForDiagnostics: "editor placeholder", documentation: """ - Warning: This ``EditorPlaceholderExprSyntax`` node is not generated by the parser anymore. Placeholders are represented by a ``DeclReferenceExprSyntax``. @@ -800,7 +767,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .exprList, - base: .syntaxCollection, nameForDiagnostics: nil, documentation: "A list of expressions connected by operators. This list is contained by a ``SequenceExprSyntax``.", elementChoices: [.expr] @@ -808,7 +774,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .expressionSegment, - base: .syntax, nameForDiagnostics: nil, documentation: """ An interpolated expression inside a string literal. @@ -846,7 +811,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .floatLiteralExpr, - base: .expr, nameForDiagnostics: "floating literal", children: [ Child( @@ -859,7 +823,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .forceUnwrapExpr, - base: .expr, nameForDiagnostics: "force unwrap", children: [ Child( @@ -875,7 +838,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .functionCallExpr, - base: .expr, nameForDiagnostics: "function call", children: [ Child( @@ -919,7 +881,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .declReferenceExpr, - base: .expr, nameForDiagnostics: nil, children: [ Child( @@ -948,7 +909,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .ifExpr, - base: .expr, nameForDiagnostics: "'if' statement", traits: [ "WithCodeBlock" @@ -992,7 +952,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .inOutExpr, - base: .expr, nameForDiagnostics: "inout expression", documentation: "An expression prefixed with `&` to pass an argument to an `inout` parameter.", children: [ @@ -1009,7 +968,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .infixOperatorExpr, - base: .expr, nameForDiagnostics: nil, documentation: """ An infix operator call like `1 + 2`. @@ -1037,7 +995,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .integerLiteralExpr, - base: .expr, nameForDiagnostics: "integer literal", children: [ Child( @@ -1050,7 +1007,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .isExpr, - base: .expr, nameForDiagnostics: "'is'", documentation: """ Checks if an expression is of a given type. @@ -1088,7 +1044,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .keyPathComponentList, - base: .syntaxCollection, nameForDiagnostics: nil, documentation: "The components of a key path", elementChoices: [.keyPathComponent] @@ -1096,7 +1051,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .keyPathComponent, - base: .syntax, nameForDiagnostics: "key path component", documentation: "A single key path component", children: [ @@ -1127,7 +1081,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .keyPathExpr, - base: .expr, nameForDiagnostics: "key path", documentation: #""" A key path. @@ -1158,7 +1111,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .keyPathOptionalComponent, - base: .syntax, nameForDiagnostics: "key path optional component", documentation: "A key path component like `?` or `!`.", children: [ @@ -1171,7 +1123,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .keyPathPropertyComponent, - base: .syntax, nameForDiagnostics: "key path property component", documentation: "A key path component like `.property` or `.1`.", children: [ @@ -1189,7 +1140,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .keyPathSubscriptComponent, - base: .syntax, nameForDiagnostics: "key path subscript component", documentation: "A key path component like `.[17]`", children: [ @@ -1214,7 +1164,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .macroExpansionExpr, - base: .expr, nameForDiagnostics: "macro expansion", documentation: "The expansion of a freestanding macro in a position that expects an expression.", traits: [ @@ -1271,7 +1220,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .memberAccessExpr, - base: .expr, nameForDiagnostics: "member access", documentation: "An expression that access a member like a function or a property.", children: [ @@ -1298,7 +1246,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .consumeExpr, - base: .expr, nameForDiagnostics: "'consume' expression", children: [ Child( @@ -1315,7 +1262,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .copyExpr, - base: .expr, nameForDiagnostics: "'copy' expression", children: [ Child( @@ -1331,14 +1277,12 @@ public let EXPR_NODES: [Node] = [ Node( kind: .multipleTrailingClosureElementList, - base: .syntaxCollection, nameForDiagnostics: nil, elementChoices: [.multipleTrailingClosureElement] ), Node( kind: .multipleTrailingClosureElement, - base: .syntax, nameForDiagnostics: "trailing closure", children: [ Child( @@ -1359,7 +1303,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .nilLiteralExpr, - base: .expr, nameForDiagnostics: nil, children: [ Child( @@ -1371,7 +1314,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .optionalChainingExpr, - base: .expr, nameForDiagnostics: "optional chaining", children: [ Child( @@ -1387,7 +1329,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .packElementExpr, - base: .expr, nameForDiagnostics: nil, documentation: "A pack element expression spelled with `each`.", children: [ @@ -1405,7 +1346,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .packExpansionExpr, - base: .expr, nameForDiagnostics: nil, documentation: "A pack expansion expression spelled with `repeat`.", children: [ @@ -1423,7 +1363,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .postfixIfConfigExpr, - base: .expr, nameForDiagnostics: nil, children: [ Child( @@ -1440,7 +1379,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .postfixOperatorExpr, - base: .expr, nameForDiagnostics: "postfix expression", children: [ Child( @@ -1457,7 +1395,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .prefixOperatorExpr, - base: .expr, nameForDiagnostics: "operator", documentation: """ A prefix operator applied to a value. @@ -1488,7 +1425,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .regexLiteralExpr, - base: .expr, nameForDiagnostics: "regex literal", children: [ Child( @@ -1521,7 +1457,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .sequenceExpr, - base: .expr, nameForDiagnostics: nil, documentation: """ A flat list of expressions before operator folding using the `SwiftOperators` library. @@ -1542,7 +1477,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .genericSpecializationExpr, - base: .expr, nameForDiagnostics: nil, children: [ Child( @@ -1558,7 +1492,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .stringLiteralExpr, - base: .expr, nameForDiagnostics: "string literal", documentation: #""" A string literal. @@ -1601,14 +1534,12 @@ public let EXPR_NODES: [Node] = [ Node( kind: .stringLiteralSegmentList, - base: .syntaxCollection, nameForDiagnostics: nil, elementChoices: [.stringSegment, .expressionSegment] ), Node( kind: .simpleStringLiteralExpr, - base: .expr, nameForDiagnostics: "simple string literal", documentation: "A simple string that can’t contain string interpolation and cannot have raw string delimiters.", children: [ @@ -1632,7 +1563,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .simpleStringLiteralSegmentList, - base: .syntaxCollection, nameForDiagnostics: nil, documentation: "String literal segments that only can contain non string interpolated or extended escaped strings", elementChoices: [.stringSegment] @@ -1640,7 +1570,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .stringSegment, - base: .syntax, nameForDiagnostics: nil, documentation: """ A literal segment inside a string segment. @@ -1657,7 +1586,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .subscriptCallExpr, - base: .expr, nameForDiagnostics: "subscript", children: [ Child( @@ -1701,7 +1629,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .superExpr, - base: .expr, nameForDiagnostics: nil, children: [ Child( @@ -1713,7 +1640,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .switchCaseLabel, - base: .syntax, nameForDiagnostics: nil, children: [ Child( @@ -1733,14 +1659,12 @@ public let EXPR_NODES: [Node] = [ Node( kind: .switchCaseList, - base: .syntaxCollection, nameForDiagnostics: nil, elementChoices: [.switchCase, .ifConfigDecl] ), Node( kind: .switchCase, - base: .syntax, nameForDiagnostics: "switch case", parserFunction: "parseSwitchCase", traits: ["WithStatements"], @@ -1775,7 +1699,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .switchDefaultLabel, - base: .syntax, nameForDiagnostics: nil, children: [ Child( @@ -1791,7 +1714,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .switchExpr, - base: .expr, nameForDiagnostics: "'switch' statement", documentation: """ A `switch` expression. @@ -1842,7 +1764,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .ternaryExpr, - base: .expr, nameForDiagnostics: "ternay expression", documentation: """ The ternary operator with operator precedences resolved. @@ -1889,7 +1810,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .tryExpr, - base: .expr, nameForDiagnostics: "'try' expression", documentation: """ An expression prefixed with `try`. @@ -1927,14 +1847,12 @@ public let EXPR_NODES: [Node] = [ Node( kind: .labeledExprList, - base: .syntaxCollection, nameForDiagnostics: nil, elementChoices: [.labeledExpr] ), Node( kind: .labeledExpr, - base: .syntax, nameForDiagnostics: nil, documentation: """ An expression that is prefixed by a label. @@ -1973,7 +1891,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .tupleExpr, - base: .expr, nameForDiagnostics: "tuple", traits: [ "Parenthesized" @@ -1997,7 +1914,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .typeExpr, - base: .expr, nameForDiagnostics: nil, children: [ Child( @@ -2009,7 +1925,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .unresolvedAsExpr, - base: .expr, nameForDiagnostics: "'as'", documentation: """ The `as` keyword without any operands. @@ -2033,7 +1948,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .unresolvedIsExpr, - base: .expr, nameForDiagnostics: "'is'", documentation: """ The `is` keyword without any operands. @@ -2052,7 +1966,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .patternExpr, - base: .expr, nameForDiagnostics: nil, children: [ Child( @@ -2064,7 +1977,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .unresolvedTernaryExpr, - base: .expr, nameForDiagnostics: "ternary operator", documentation: """ The middle section of a ternary operator between `?` and `:`. @@ -2093,7 +2005,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .yieldedExpression, - base: .syntax, nameForDiagnostics: nil, children: [ Child( @@ -2110,7 +2021,6 @@ public let EXPR_NODES: [Node] = [ Node( kind: .yieldedExpressionList, - base: .syntaxCollection, nameForDiagnostics: "yield list", elementChoices: [.yieldedExpression] ), diff --git a/CodeGeneration/Sources/SyntaxSupport/GenericNodes.swift b/CodeGeneration/Sources/SyntaxSupport/GenericNodes.swift index 0b155c0bf01..70d8b0324dd 100644 --- a/CodeGeneration/Sources/SyntaxSupport/GenericNodes.swift +++ b/CodeGeneration/Sources/SyntaxSupport/GenericNodes.swift @@ -13,7 +13,6 @@ public let GENERIC_NODES: [Node] = [ Node( kind: .conformanceRequirement, - base: .syntax, nameForDiagnostics: "conformance requirement", children: [ Child( @@ -35,7 +34,6 @@ public let GENERIC_NODES: [Node] = [ Node( kind: .genericParameterClause, - base: .syntax, nameForDiagnostics: "generic parameter clause", documentation: "The parameter clause that defines the generic parameters.", parserFunction: "parseGenericParameters", @@ -74,14 +72,12 @@ public let GENERIC_NODES: [Node] = [ Node( kind: .genericParameterList, - base: .syntaxCollection, nameForDiagnostics: nil, elementChoices: [.genericParameter] ), Node( kind: .genericParameter, - base: .syntax, nameForDiagnostics: "generic parameter", traits: [ "WithTrailingComma", @@ -125,14 +121,12 @@ public let GENERIC_NODES: [Node] = [ Node( kind: .genericRequirementList, - base: .syntaxCollection, nameForDiagnostics: nil, elementChoices: [.genericRequirement] ), Node( kind: .genericRequirement, - base: .syntax, nameForDiagnostics: nil, traits: [ "WithTrailingComma" @@ -166,7 +160,6 @@ public let GENERIC_NODES: [Node] = [ Node( kind: .genericWhereClause, - base: .syntax, nameForDiagnostics: "'where' clause", documentation: "A `where` clause that places additional constraints on generic parameters like `where Element: Hashable`.", @@ -187,7 +180,6 @@ public let GENERIC_NODES: [Node] = [ Node( kind: .layoutRequirement, - base: .syntax, nameForDiagnostics: "layout requirement", children: [ Child( @@ -247,7 +239,6 @@ public let GENERIC_NODES: [Node] = [ Node( kind: .primaryAssociatedTypeClause, - base: .syntax, nameForDiagnostics: "primary associated type clause", children: [ Child( @@ -270,14 +261,12 @@ public let GENERIC_NODES: [Node] = [ Node( kind: .primaryAssociatedTypeList, - base: .syntaxCollection, nameForDiagnostics: nil, elementChoices: [.primaryAssociatedType] ), Node( kind: .primaryAssociatedType, - base: .syntax, nameForDiagnostics: nil, traits: [ "WithTrailingComma" @@ -298,7 +287,6 @@ public let GENERIC_NODES: [Node] = [ Node( kind: .sameTypeRequirement, - base: .syntax, nameForDiagnostics: "same type requirement", children: [ Child( diff --git a/CodeGeneration/Sources/SyntaxSupport/Node.swift b/CodeGeneration/Sources/SyntaxSupport/Node.swift index 3205f0425f7..03516b6643e 100644 --- a/CodeGeneration/Sources/SyntaxSupport/Node.swift +++ b/CodeGeneration/Sources/SyntaxSupport/Node.swift @@ -38,7 +38,9 @@ public class Node: NodeChoiceConvertible { public let kind: SyntaxNodeKind /// The kind of node’s supertype. This kind must have `isBase == true` - public let base: SyntaxNodeKind + public var base: SyntaxNodeKind { + self.kind.base + } public let experimentalFeature: ExperimentalFeature? @@ -117,7 +119,6 @@ public class Node: NodeChoiceConvertible { /// Construct the specification for a layout syntax node. init( kind: SyntaxNodeKind, - base: SyntaxNodeKind, experimentalFeature: ExperimentalFeature? = nil, nameForDiagnostics: String?, documentation: String? = nil, @@ -125,11 +126,10 @@ public class Node: NodeChoiceConvertible { traits: [String] = [], children: [Child] = [] ) { - precondition(base != .syntaxCollection) - precondition(base.isBase, "unknown base kind '\(base)' for node '\(kind)'") + precondition(kind.base != .syntaxCollection) + precondition(kind.base.isBase, "unknown base kind '\(kind.base)' for node '\(kind)'") self.kind = kind - self.base = base self.experimentalFeature = experimentalFeature self.nameForDiagnostics = nameForDiagnostics self.documentation = SwiftSyntax.Trivia.docCommentTrivia(from: documentation) @@ -274,7 +274,6 @@ public class Node: NodeChoiceConvertible { /// `base` must be `.syntaxCollection`. init( kind: SyntaxNodeKind, - base: SyntaxNodeKind, experimentalFeature: ExperimentalFeature? = nil, nameForDiagnostics: String?, documentation: String? = nil, @@ -282,8 +281,7 @@ public class Node: NodeChoiceConvertible { elementChoices: [SyntaxNodeKind] ) { self.kind = kind - precondition(base == .syntaxCollection) - self.base = base + precondition(kind.base == .syntaxCollection) self.experimentalFeature = experimentalFeature self.nameForDiagnostics = nameForDiagnostics self.documentation = SwiftSyntax.Trivia.docCommentTrivia(from: documentation) diff --git a/CodeGeneration/Sources/SyntaxSupport/PatternNodes.swift b/CodeGeneration/Sources/SyntaxSupport/PatternNodes.swift index 83d45dd71ec..c8868aa1ab6 100644 --- a/CodeGeneration/Sources/SyntaxSupport/PatternNodes.swift +++ b/CodeGeneration/Sources/SyntaxSupport/PatternNodes.swift @@ -13,7 +13,6 @@ public let PATTERN_NODES: [Node] = [ Node( kind: .expressionPattern, - base: .pattern, nameForDiagnostics: "pattern", documentation: """ A pattern that contains an ``ExprSyntaxProtocol``. @@ -40,7 +39,6 @@ public let PATTERN_NODES: [Node] = [ Node( kind: .identifierPattern, - base: .pattern, nameForDiagnostics: "pattern", documentation: """ A pattern that contains a ``TokenSyntax``. @@ -72,7 +70,6 @@ public let PATTERN_NODES: [Node] = [ Node( kind: .isTypePattern, - base: .pattern, nameForDiagnostics: "'is' pattern", children: [ Child( @@ -88,7 +85,6 @@ public let PATTERN_NODES: [Node] = [ Node( kind: .tuplePatternElementList, - base: .syntaxCollection, nameForDiagnostics: nil, documentation: """ A list of ``TuplePatternElementSyntax``. @@ -98,7 +94,6 @@ public let PATTERN_NODES: [Node] = [ Node( kind: .tuplePatternElement, - base: .syntax, nameForDiagnostics: nil, documentation: """ An element that represents a single tuple value in ``TuplePatternElementListSyntax``. @@ -138,7 +133,6 @@ public let PATTERN_NODES: [Node] = [ Node( kind: .tuplePattern, - base: .pattern, nameForDiagnostics: "tuple pattern", documentation: """ A pattern that contains a list of other pattern. @@ -175,7 +169,6 @@ public let PATTERN_NODES: [Node] = [ Node( kind: .typeAnnotation, - base: .syntax, nameForDiagnostics: "type annotation", children: [ Child( @@ -192,7 +185,6 @@ public let PATTERN_NODES: [Node] = [ Node( kind: .valueBindingPattern, - base: .pattern, nameForDiagnostics: "value binding pattern", children: [ Child( @@ -214,7 +206,6 @@ public let PATTERN_NODES: [Node] = [ Node( kind: .wildcardPattern, - base: .pattern, nameForDiagnostics: "wildcard pattern", documentation: """ A pattern that represent a wildcard. diff --git a/CodeGeneration/Sources/SyntaxSupport/RawSyntaxNodeKind.swift b/CodeGeneration/Sources/SyntaxSupport/RawSyntaxNodeKind.swift index ded2446914e..39a4e8f9f0b 100644 --- a/CodeGeneration/Sources/SyntaxSupport/RawSyntaxNodeKind.swift +++ b/CodeGeneration/Sources/SyntaxSupport/RawSyntaxNodeKind.swift @@ -20,6 +20,10 @@ public struct RawSyntaxNodeKind: TypeConvertible { self.syntaxNodeKind.isBase } + public var base: RawSyntaxNodeKind { + Self(syntaxNodeKind: self.syntaxNodeKind.base) + } + public var syntaxType: TypeSyntax { "Raw\(self.syntaxNodeKind.syntaxType)" } diff --git a/CodeGeneration/Sources/SyntaxSupport/StmtNodes.swift b/CodeGeneration/Sources/SyntaxSupport/StmtNodes.swift index 8d641dc5218..47c474a21cb 100644 --- a/CodeGeneration/Sources/SyntaxSupport/StmtNodes.swift +++ b/CodeGeneration/Sources/SyntaxSupport/StmtNodes.swift @@ -13,7 +13,6 @@ public let STMT_NODES: [Node] = [ Node( kind: .availabilityCondition, - base: .syntax, nameForDiagnostics: "availability condition", children: [ Child( @@ -38,7 +37,6 @@ public let STMT_NODES: [Node] = [ Node( kind: .breakStmt, - base: .stmt, nameForDiagnostics: "'break' statement", children: [ Child( @@ -56,21 +54,18 @@ public let STMT_NODES: [Node] = [ Node( kind: .switchCaseItemList, - base: .syntaxCollection, nameForDiagnostics: nil, elementChoices: [.switchCaseItem] ), Node( kind: .catchClauseList, - base: .syntaxCollection, nameForDiagnostics: "'catch' clause", elementChoices: [.catchClause] ), Node( kind: .catchClause, - base: .syntax, nameForDiagnostics: "'catch' clause", parserFunction: "parseCatchClause", traits: ["WithCodeBlock"], @@ -92,14 +87,12 @@ public let STMT_NODES: [Node] = [ Node( kind: .catchItemList, - base: .syntaxCollection, nameForDiagnostics: nil, elementChoices: [.catchItem] ), Node( kind: .catchItem, - base: .syntax, nameForDiagnostics: nil, traits: [ "WithTrailingComma" @@ -125,14 +118,12 @@ public let STMT_NODES: [Node] = [ Node( kind: .conditionElementList, - base: .syntaxCollection, nameForDiagnostics: nil, elementChoices: [.conditionElement] ), Node( kind: .conditionElement, - base: .syntax, nameForDiagnostics: nil, traits: [ "WithTrailingComma" @@ -169,7 +160,6 @@ public let STMT_NODES: [Node] = [ Node( kind: .continueStmt, - base: .stmt, nameForDiagnostics: "'continue' statement", children: [ Child( @@ -187,7 +177,6 @@ public let STMT_NODES: [Node] = [ Node( kind: .deferStmt, - base: .stmt, nameForDiagnostics: "'defer' statement", traits: [ "WithCodeBlock" @@ -206,7 +195,6 @@ public let STMT_NODES: [Node] = [ Node( kind: .doStmt, - base: .stmt, nameForDiagnostics: "'do' statement", traits: [ "WithCodeBlock" @@ -236,7 +224,6 @@ public let STMT_NODES: [Node] = [ Node( kind: .expressionStmt, - base: .stmt, nameForDiagnostics: "expression", children: [ Child( @@ -248,7 +235,6 @@ public let STMT_NODES: [Node] = [ Node( kind: .fallThroughStmt, - base: .stmt, nameForDiagnostics: "'fallthrough' statement", children: [ Child( @@ -260,7 +246,6 @@ public let STMT_NODES: [Node] = [ Node( kind: .forStmt, - base: .stmt, nameForDiagnostics: "'for' statement", traits: [ "WithCodeBlock" @@ -318,7 +303,6 @@ public let STMT_NODES: [Node] = [ Node( kind: .discardStmt, - base: .stmt, nameForDiagnostics: "'discard' statement", children: [ Child( @@ -334,7 +318,6 @@ public let STMT_NODES: [Node] = [ Node( kind: .guardStmt, - base: .stmt, nameForDiagnostics: "'guard' statement", traits: [ "WithCodeBlock" @@ -363,7 +346,6 @@ public let STMT_NODES: [Node] = [ Node( kind: .labeledStmt, - base: .stmt, nameForDiagnostics: "labeled statement", children: [ Child( @@ -386,7 +368,6 @@ public let STMT_NODES: [Node] = [ Node( kind: .matchingPatternCondition, - base: .syntax, nameForDiagnostics: "pattern matching", children: [ Child( @@ -411,7 +392,6 @@ public let STMT_NODES: [Node] = [ Node( kind: .optionalBindingCondition, - base: .syntax, nameForDiagnostics: "optional binding", children: [ Child( @@ -441,7 +421,6 @@ public let STMT_NODES: [Node] = [ Node( kind: .repeatStmt, - base: .stmt, nameForDiagnostics: "'repeat' statement", traits: [ "WithCodeBlock" @@ -470,7 +449,6 @@ public let STMT_NODES: [Node] = [ Node( kind: .returnStmt, - base: .stmt, nameForDiagnostics: "'return' statement", children: [ Child( @@ -487,7 +465,6 @@ public let STMT_NODES: [Node] = [ Node( kind: .throwStmt, - base: .stmt, nameForDiagnostics: "'throw' statement", children: [ Child( @@ -503,7 +480,6 @@ public let STMT_NODES: [Node] = [ Node( kind: .whereClause, - base: .syntax, nameForDiagnostics: "'where' clause", children: [ Child( @@ -520,7 +496,6 @@ public let STMT_NODES: [Node] = [ Node( kind: .whileStmt, - base: .stmt, nameForDiagnostics: "'while' statement", traits: [ "WithCodeBlock" @@ -543,7 +518,6 @@ public let STMT_NODES: [Node] = [ Node( kind: .yieldedExpressionsClause, - base: .syntax, nameForDiagnostics: nil, children: [ Child( @@ -564,7 +538,6 @@ public let STMT_NODES: [Node] = [ Node( kind: .yieldStmt, - base: .stmt, nameForDiagnostics: "'yield' statement", children: [ Child( @@ -592,7 +565,6 @@ public let STMT_NODES: [Node] = [ Node( kind: .thenStmt, - base: .stmt, experimentalFeature: .thenStatements, nameForDiagnostics: "'then' statement", documentation: """ diff --git a/CodeGeneration/Sources/SyntaxSupport/SyntaxNodeKind.swift b/CodeGeneration/Sources/SyntaxSupport/SyntaxNodeKind.swift index aca5c52aa86..057fef48458 100644 --- a/CodeGeneration/Sources/SyntaxSupport/SyntaxNodeKind.swift +++ b/CodeGeneration/Sources/SyntaxSupport/SyntaxNodeKind.swift @@ -336,6 +336,80 @@ public enum SyntaxNodeKind: String, CaseIterable, IdentifierConvertible, TypeCon } } + public var base: Self { + switch self { + case .accessorDecl, .actorDecl, .associatedTypeDecl, .classDecl, .deinitializerDecl, .editorPlaceholderDecl, + .enumCaseDecl, .enumDecl, .extensionDecl, .functionDecl, .ifConfigDecl, .importDecl, .initializerDecl, .macroDecl, + .macroExpansionDecl, .missingDecl, .operatorDecl, .poundSourceLocation, .precedenceGroupDecl, .protocolDecl, + .structDecl, .subscriptDecl, .typeAliasDecl, .variableDecl: + return .decl + case ._canImportExpr, ._canImportVersionInfo, .arrayExpr, .arrowExpr, .asExpr, .assignmentExpr, .awaitExpr, + .binaryOperatorExpr, .booleanLiteralExpr, .borrowExpr, .closureExpr, .consumeExpr, .copyExpr, .declReferenceExpr, + .dictionaryExpr, .discardAssignmentExpr, .doExpr, .editorPlaceholderExpr, .floatLiteralExpr, .forceUnwrapExpr, + .functionCallExpr, .genericSpecializationExpr, .ifExpr, .infixOperatorExpr, .inOutExpr, .integerLiteralExpr, + .isExpr, .keyPathExpr, .macroExpansionExpr, .memberAccessExpr, .missingExpr, .nilLiteralExpr, + .optionalChainingExpr, .packElementExpr, .packExpansionExpr, .patternExpr, .postfixIfConfigExpr, + .postfixOperatorExpr, .prefixOperatorExpr, .regexLiteralExpr, .sequenceExpr, .simpleStringLiteralExpr, + .stringLiteralExpr, .subscriptCallExpr, .superExpr, .switchExpr, .ternaryExpr, .tryExpr, .tupleExpr, .typeExpr, + .unresolvedAsExpr, .unresolvedIsExpr, .unresolvedTernaryExpr: + return .expr + case .expressionPattern, .identifierPattern, .isTypePattern, .missingPattern, .tuplePattern, .valueBindingPattern, + .wildcardPattern: + return .pattern + case .breakStmt, .continueStmt, .deferStmt, .discardStmt, .doStmt, .expressionStmt, .fallThroughStmt, .forStmt, + .guardStmt, .labeledStmt, .missingStmt, .repeatStmt, .returnStmt, .thenStmt, .throwStmt, .whileStmt, .yieldStmt: + return .stmt + case .arrayType, .attributedType, .classRestrictionType, .compositionType, .dictionaryType, .functionType, + .identifierType, .implicitlyUnwrappedOptionalType, .memberType, .metatypeType, .missingType, + .namedOpaqueReturnType, .optionalType, .packElementType, .packExpansionType, .someOrAnyType, .suppressedType, + .tupleType: + return .type + case .accessorDeclList, .arrayElementList, .attributeList, .availabilityArgumentList, .catchClauseList, + .catchItemList, .closureCaptureList, .closureParameterList, .closureShorthandParameterList, .codeBlockItemList, + .compositionTypeElementList, .conditionElementList, .declModifierList, .declNameArgumentList, .designatedTypeList, + .dictionaryElementList, .differentiabilityArgumentList, .documentationAttributeArgumentList, + .effectsAttributeArgumentList, .enumCaseElementList, .enumCaseParameterList, .exprList, .functionParameterList, + .genericArgumentList, .genericParameterList, .genericRequirementList, .ifConfigClauseList, + .importPathComponentList, .inheritedTypeList, .keyPathComponentList, .labeledExprList, + .lifetimeSpecifierArgumentList, .memberBlockItemList, .multipleTrailingClosureElementList, .objCSelectorPieceList, + .patternBindingList, .platformVersionItemList, .precedenceGroupAttributeList, .precedenceGroupNameList, + .primaryAssociatedTypeList, .simpleStringLiteralSegmentList, .specializeAttributeArgumentList, + .stringLiteralSegmentList, .switchCaseItemList, .switchCaseList, .tuplePatternElementList, .tupleTypeElementList, + .typeSpecifierList, .unexpectedNodes, .versionComponentList, .yieldedExpressionList: + return .syntaxCollection + case .accessorBlock, .accessorEffectSpecifiers, .accessorParameters, .arrayElement, .attribute, + .availabilityArgument, .availabilityCondition, .availabilityLabeledArgument, .backDeployedAttributeArguments, + .catchClause, .catchItem, .closureCapture, .closureCaptureClause, .closureCaptureSpecifier, .closureParameter, + .closureParameterClause, .closureShorthandParameter, .closureSignature, .codeBlock, .codeBlockItem, + .compositionTypeElement, .conditionElement, .conformanceRequirement, .conventionAttributeArguments, + .conventionWitnessMethodAttributeArguments, .decl, .declModifier, .declModifierDetail, .declNameArgument, + .declNameArguments, .deinitializerEffectSpecifiers, .derivativeAttributeArguments, .designatedType, + .dictionaryElement, .differentiabilityArgument, .differentiabilityArguments, + .differentiabilityWithRespectToArgument, .differentiableAttributeArguments, .documentationAttributeArgument, + .dynamicReplacementAttributeArguments, .enumCaseElement, .enumCaseParameter, .enumCaseParameterClause, + .exposeAttributeArguments, .expr, .expressionSegment, .functionEffectSpecifiers, .functionParameter, + .functionParameterClause, .functionSignature, .genericArgument, .genericArgumentClause, .genericParameter, + .genericParameterClause, .genericRequirement, .genericWhereClause, .ifConfigClause, .implementsAttributeArguments, + .importPathComponent, .inheritanceClause, .inheritedType, .initializerClause, .keyPathComponent, + .keyPathOptionalComponent, .keyPathPropertyComponent, .keyPathSubscriptComponent, .labeledExpr, + .labeledSpecializeArgument, .layoutRequirement, .lifetimeSpecifierArgument, .lifetimeTypeSpecifier, + .matchingPatternCondition, .memberBlock, .memberBlockItem, .missing, .multipleTrailingClosureElement, + .objCSelectorPiece, .opaqueReturnTypeOfAttributeArguments, .operatorPrecedenceAndTypes, .optionalBindingCondition, + .originallyDefinedInAttributeArguments, .pattern, .patternBinding, .platformVersion, .platformVersionItem, + .poundSourceLocationArguments, .precedenceGroupAssignment, .precedenceGroupAssociativity, .precedenceGroupName, + .precedenceGroupRelation, .primaryAssociatedType, .primaryAssociatedTypeClause, .returnClause, + .sameTypeRequirement, .simpleTypeSpecifier, .sourceFile, .specializeAvailabilityArgument, + .specializeTargetFunctionArgument, .stmt, .stringSegment, .switchCase, .switchCaseItem, .switchCaseLabel, + .switchDefaultLabel, .throwsClause, .tuplePatternElement, .tupleTypeElement, .type, .typeAnnotation, + .typeEffectSpecifiers, .typeInitializerClause, .typeSpecifier, .lifetimeSpecifierArguments, + .unavailableFromAsyncAttributeArguments, .underscorePrivateAttributeArguments, .versionComponent, .versionTuple, + .whereClause, .yieldedExpression, .yieldedExpressionsClause: + return .syntax + case .syntax, .syntaxCollection, .token: + return .syntax + } + } + public var identifier: TokenSyntax { return .identifier(rawValue) } diff --git a/CodeGeneration/Sources/SyntaxSupport/TypeNodes.swift b/CodeGeneration/Sources/SyntaxSupport/TypeNodes.swift index 527843d4e90..3960397fc6b 100644 --- a/CodeGeneration/Sources/SyntaxSupport/TypeNodes.swift +++ b/CodeGeneration/Sources/SyntaxSupport/TypeNodes.swift @@ -13,7 +13,6 @@ public let TYPE_NODES: [Node] = [ Node( kind: .arrayType, - base: .type, nameForDiagnostics: "array type", children: [ Child( @@ -36,7 +35,6 @@ public let TYPE_NODES: [Node] = [ Node( kind: .attributedType, - base: .type, nameForDiagnostics: "type", traits: [ "WithAttributes" @@ -63,7 +61,6 @@ public let TYPE_NODES: [Node] = [ Node( kind: .classRestrictionType, - base: .type, nameForDiagnostics: nil, children: [ Child( @@ -75,14 +72,12 @@ public let TYPE_NODES: [Node] = [ Node( kind: .compositionTypeElementList, - base: .syntaxCollection, nameForDiagnostics: nil, elementChoices: [.compositionTypeElement] ), Node( kind: .compositionTypeElement, - base: .syntax, nameForDiagnostics: nil, children: [ Child( @@ -99,7 +94,6 @@ public let TYPE_NODES: [Node] = [ Node( kind: .compositionType, - base: .type, nameForDiagnostics: "type composition", children: [ Child( @@ -111,7 +105,6 @@ public let TYPE_NODES: [Node] = [ Node( kind: .someOrAnyType, - base: .type, nameForDiagnostics: "type", children: [ Child( @@ -128,7 +121,6 @@ public let TYPE_NODES: [Node] = [ Node( kind: .dictionaryType, - base: .type, nameForDiagnostics: "dictionary type", children: [ Child( @@ -162,7 +154,6 @@ public let TYPE_NODES: [Node] = [ Node( kind: .functionType, - base: .type, nameForDiagnostics: "function type", traits: [ "Parenthesized" @@ -200,7 +191,6 @@ public let TYPE_NODES: [Node] = [ Node( kind: .genericArgumentClause, - base: .syntax, nameForDiagnostics: "generic argument clause", children: [ Child( @@ -222,14 +212,12 @@ public let TYPE_NODES: [Node] = [ Node( kind: .genericArgumentList, - base: .syntaxCollection, nameForDiagnostics: nil, elementChoices: [.genericArgument] ), Node( kind: .genericArgument, - base: .syntax, nameForDiagnostics: "generic argument", traits: [ "WithTrailingComma" @@ -250,7 +238,6 @@ public let TYPE_NODES: [Node] = [ Node( kind: .implicitlyUnwrappedOptionalType, - base: .type, nameForDiagnostics: "implicitly unwrapped optional type", children: [ Child( @@ -266,7 +253,6 @@ public let TYPE_NODES: [Node] = [ Node( kind: .memberType, - base: .type, nameForDiagnostics: "member type", children: [ Child( @@ -293,7 +279,6 @@ public let TYPE_NODES: [Node] = [ Node( kind: .metatypeType, - base: .type, nameForDiagnostics: "metatype", children: [ Child( @@ -315,7 +300,6 @@ public let TYPE_NODES: [Node] = [ Node( kind: .namedOpaqueReturnType, - base: .type, nameForDiagnostics: "named opaque return type", children: [ Child( @@ -334,7 +318,6 @@ public let TYPE_NODES: [Node] = [ Node( kind: .optionalType, - base: .type, nameForDiagnostics: "optional type", children: [ Child( @@ -350,7 +333,6 @@ public let TYPE_NODES: [Node] = [ Node( kind: .suppressedType, - base: .type, nameForDiagnostics: "suppressed type conformance", children: [ Child( @@ -367,7 +349,6 @@ public let TYPE_NODES: [Node] = [ Node( kind: .packExpansionType, - base: .type, nameForDiagnostics: "variadic expansion", children: [ Child( @@ -384,7 +365,6 @@ public let TYPE_NODES: [Node] = [ Node( kind: .packElementType, - base: .type, nameForDiagnostics: "pack element", children: [ Child( @@ -401,7 +381,6 @@ public let TYPE_NODES: [Node] = [ Node( kind: .identifierType, - base: .type, nameForDiagnostics: "type", children: [ Child( @@ -423,14 +402,12 @@ public let TYPE_NODES: [Node] = [ Node( kind: .tupleTypeElementList, - base: .syntaxCollection, nameForDiagnostics: nil, elementChoices: [.tupleTypeElement] ), Node( kind: .tupleTypeElement, - base: .syntax, nameForDiagnostics: nil, traits: [ "WithTrailingComma" @@ -479,7 +456,6 @@ public let TYPE_NODES: [Node] = [ Node( kind: .tupleType, - base: .type, nameForDiagnostics: "tuple type", traits: [ "Parenthesized" @@ -502,7 +478,6 @@ public let TYPE_NODES: [Node] = [ Node( kind: .lifetimeSpecifierArgument, - base: .syntax, experimentalFeature: .nonescapableTypes, nameForDiagnostics: nil, documentation: """ @@ -536,7 +511,6 @@ public let TYPE_NODES: [Node] = [ Node( kind: .lifetimeSpecifierArgumentList, - base: .syntaxCollection, experimentalFeature: .nonescapableTypes, nameForDiagnostics: nil, elementChoices: [.lifetimeSpecifierArgument] @@ -544,7 +518,6 @@ public let TYPE_NODES: [Node] = [ Node( kind: .lifetimeTypeSpecifier, - base: .syntax, experimentalFeature: .nonescapableTypes, nameForDiagnostics: "lifetime specifier", documentation: "A specifier that specifies function parameter on whose lifetime a type depends", @@ -577,7 +550,6 @@ public let TYPE_NODES: [Node] = [ Node( kind: .simpleTypeSpecifier, - base: .syntax, nameForDiagnostics: "type specifier", documentation: "A specifier that can be attached to a type to eg. mark a parameter as `inout` or `consuming`", children: [ @@ -600,7 +572,6 @@ public let TYPE_NODES: [Node] = [ Node( kind: .typeSpecifierList, - base: .syntaxCollection, nameForDiagnostics: nil, elementChoices: [.simpleTypeSpecifier, .lifetimeTypeSpecifier] ),