diff --git a/CodeGeneration/Sources/SyntaxSupport/Child.swift b/CodeGeneration/Sources/SyntaxSupport/Child.swift index c9a4eef565c..fd4bf988bce 100644 --- a/CodeGeneration/Sources/SyntaxSupport/Child.swift +++ b/CodeGeneration/Sources/SyntaxSupport/Child.swift @@ -87,8 +87,25 @@ public class Child { /// This is used to e.g. describe the child if all of its tokens are missing in the source file. public let nameForDiagnostics: String? - /// A doc comment describing the child. - public let documentation: SwiftSyntax.Trivia + /// A summary of a doc comment describing the child. Full docc comment for the + /// child is available in ``Child/documentation``, and includes detailed list + /// of possible choices for the child if it's a token kind. + public let documentationSummary: SwiftSyntax.Trivia + + /// A docc comment describing the child, including the trivia provided when + /// initializing the ``Child``, and the list of possible token choices inferred automatically. + public var documentation: SwiftSyntax.Trivia { + if case .token(let choices, _, _) = kind { + let tokenChoicesTrivia = SwiftSyntax.Trivia.docCommentTrivia( + from: GrammarGenerator.childTokenChoices(for: choices) + ) + + return SwiftSyntax.Trivia(joining: [documentationSummary, tokenChoicesTrivia]) + } + + // If this child is not a token kind, return documentation summary without the choices list. + return documentationSummary + } /// The first line of the child's documentation public let documentationAbstract: String @@ -220,7 +237,7 @@ public class Child { self.deprecatedName = deprecatedName self.kind = kind self.nameForDiagnostics = nameForDiagnostics - self.documentation = docCommentTrivia(from: documentation) + self.documentationSummary = SwiftSyntax.Trivia.docCommentTrivia(from: documentation) self.documentationAbstract = String(documentation?.split(whereSeparator: \.isNewline).first ?? "") self.isOptional = isOptional } diff --git a/CodeGeneration/Sources/SyntaxSupport/GrammarGenerator.swift b/CodeGeneration/Sources/SyntaxSupport/GrammarGenerator.swift index 6e83ba28c27..deeadde1d6f 100644 --- a/CodeGeneration/Sources/SyntaxSupport/GrammarGenerator.swift +++ b/CodeGeneration/Sources/SyntaxSupport/GrammarGenerator.swift @@ -14,14 +14,19 @@ import SwiftSyntax /// Generates grammar doc comments for syntax nodes. struct GrammarGenerator { + + /// Returns grammar for a ``TokenChoice``. + /// + /// - parameters: + /// - tokenChoice: ``TokenChoice`` to describe private func grammar(for tokenChoice: TokenChoice) -> String { switch tokenChoice { case .keyword(let keyword): - return "`'\(keyword.spec.name)'`" + return "`\(keyword.spec.name)`" case .token(let token): let tokenSpec = token.spec if let tokenText = tokenSpec.text { - return "`'\(tokenText)'`" + return "`\(tokenText)`" } else { return "`<\(tokenSpec.varOrCaseName)>`" } @@ -60,4 +65,25 @@ struct GrammarGenerator { .map { " - `\($0.varOrCaseName)`: \(generator.grammar(for: $0))" } .joined(separator: "\n") } + + /// Generates a markdown string describing possible choices for the given child + /// token. + static func childTokenChoices(for choices: [TokenChoice]) -> String { + let grammar = GrammarGenerator() + + if choices.count == 1 { + return """ + ### Tokens + + For syntax trees generated by the parser, this is guaranteed to be \(grammar.grammar(for: choices.first!)). + """ + } else { + return """ + ### Tokens + + For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + \(choices.map { " - \(grammar.grammar(for: $0))" }.joined(separator: "\n")) + """ + } + } } diff --git a/CodeGeneration/Sources/SyntaxSupport/Node.swift b/CodeGeneration/Sources/SyntaxSupport/Node.swift index 36bd7830db6..72b0698305e 100644 --- a/CodeGeneration/Sources/SyntaxSupport/Node.swift +++ b/CodeGeneration/Sources/SyntaxSupport/Node.swift @@ -121,7 +121,7 @@ public class Node { self.base = base self.isExperimental = isExperimental self.nameForDiagnostics = nameForDiagnostics - self.documentation = docCommentTrivia(from: documentation) + self.documentation = SwiftSyntax.Trivia.docCommentTrivia(from: documentation) self.parserFunction = parserFunction let childrenWithUnexpected: [Child] @@ -211,7 +211,7 @@ public class Node { } .joined(separator: "\n") - return docCommentTrivia( + return .docCommentTrivia( from: """ ### Contained in @@ -237,7 +237,7 @@ public class Node { self.base = base self.isExperimental = isExperimental self.nameForDiagnostics = nameForDiagnostics - self.documentation = docCommentTrivia(from: documentation) + self.documentation = SwiftSyntax.Trivia.docCommentTrivia(from: documentation) self.parserFunction = parserFunction assert(!elementChoices.isEmpty) @@ -299,7 +299,7 @@ public struct LayoutNode { return [] } - return docCommentTrivia( + return .docCommentTrivia( from: """ ### Children @@ -352,7 +352,7 @@ public struct CollectionNode { grammar = "(\(elementChoices.map { "``\($0.syntaxType)``" }.joined(separator: " | "))) `*`" } - return docCommentTrivia( + return .docCommentTrivia( from: """ ### Children diff --git a/CodeGeneration/Sources/SyntaxSupport/Traits.swift b/CodeGeneration/Sources/SyntaxSupport/Traits.swift index 03e4828e94f..e889de2b701 100644 --- a/CodeGeneration/Sources/SyntaxSupport/Traits.swift +++ b/CodeGeneration/Sources/SyntaxSupport/Traits.swift @@ -21,7 +21,7 @@ public class Trait { init(traitName: String, documentation: String? = nil, children: [Child]) { self.traitName = traitName self.protocolName = .identifier("\(traitName)Syntax") - self.documentation = docCommentTrivia(from: documentation) + self.documentation = SwiftSyntax.Trivia.docCommentTrivia(from: documentation) self.children = children } } diff --git a/CodeGeneration/Sources/SyntaxSupport/Utils.swift b/CodeGeneration/Sources/SyntaxSupport/Utils.swift index a42aa0fb880..c979d60d3db 100644 --- a/CodeGeneration/Sources/SyntaxSupport/Utils.swift +++ b/CodeGeneration/Sources/SyntaxSupport/Utils.swift @@ -38,21 +38,40 @@ public func lowercaseFirstWord(name: String) -> String { return name.prefix(wordIndex).lowercased() + name[name.index(name.startIndex, offsetBy: wordIndex).. SwiftSyntax.Trivia { - guard let string else { - return [] - } - let lines = string.split(separator: "\n", omittingEmptySubsequences: false) - let pieces = lines.enumerated().map { (index, line) in - var line = line - if index != lines.count - 1 { - line = "\(line)\n" +// Helpers to create trivia pieces +extension SwiftSyntax.Trivia { + /// Make a new trivia from a (possibly multi-line) string, prepending `///` + /// to each line and creating a `.docLineComment` trivia piece for each line. + public static func docCommentTrivia(from string: String?) -> SwiftSyntax.Trivia { + guard let string else { + return [] + } + + let lines = string.split(separator: "\n", omittingEmptySubsequences: false) + let pieces = lines.enumerated().map { (index, line) in + var line = line + if index != lines.count - 1 { + line = "\(line)\n" + } + return SwiftSyntax.TriviaPiece.docLineComment("/// \(line)") } - return SwiftSyntax.TriviaPiece.docLineComment("/// \(line)") + return SwiftSyntax.Trivia(pieces: pieces) + } + + /// Make a new trivia by joining together ``SwiftSyntax/TriviaPiece``s from `joining`, + /// and gluing them together with pieces from `separator`. + public init( + joining items: [SwiftSyntax.Trivia], + separator: SwiftSyntax.Trivia = SwiftSyntax.Trivia(pieces: [TriviaPiece.newlines(1), TriviaPiece.docLineComment("///"), TriviaPiece.newlines(1)]) + ) { + + self.init( + pieces: + items + .filter { !$0.isEmpty } + .joined(separator: separator) + ) } - return SwiftSyntax.Trivia(pieces: pieces) } public extension Collection { diff --git a/CodeGeneration/Sources/generate-swift-syntax/LayoutNode+Extensions.swift b/CodeGeneration/Sources/generate-swift-syntax/LayoutNode+Extensions.swift index 495cbf89bf5..dd26dd1e0c7 100644 --- a/CodeGeneration/Sources/generate-swift-syntax/LayoutNode+Extensions.swift +++ b/CodeGeneration/Sources/generate-swift-syntax/LayoutNode+Extensions.swift @@ -92,7 +92,7 @@ extension LayoutNode { If the node is empty, there is no token to attach the trivia to and the parameter is ignored. """.removingEmptyLines - return docCommentTrivia(from: formattedParams) + return SwiftSyntax.Trivia.docCommentTrivia(from: formattedParams) } /// Create a builder-based convenience initializer, if needed. diff --git a/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxCollectionsFile.swift b/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxCollectionsFile.swift index b734e8979a7..be07438bbcd 100644 --- a/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxCollectionsFile.swift +++ b/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxCollectionsFile.swift @@ -17,18 +17,11 @@ import Utils let syntaxCollectionsFile = SourceFileSyntax(leadingTrivia: copyrightHeader) { for node in SYNTAX_NODES.compactMap(\.collectionNode) { - let documentationSections = [ + let documentation = SwiftSyntax.Trivia(joining: [ node.documentation, node.grammar, node.containedIn, - ] - - let documentation = - documentationSections - .filter { !$0.isEmpty } - .map { [$0] } - .joined(separator: [Trivia.newline, Trivia.docLineComment("///"), Trivia.newline]) - .reduce(Trivia(), +) + ]) try! StructDeclSyntax( """ diff --git a/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxNodesFile.swift b/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxNodesFile.swift index c9d4389babc..e2ecf7b00a7 100644 --- a/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxNodesFile.swift +++ b/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxNodesFile.swift @@ -22,24 +22,12 @@ import Utils func syntaxNode(nodesStartingWith: [Character]) -> SourceFileSyntax { SourceFileSyntax(leadingTrivia: copyrightHeader) { for node in SYNTAX_NODES.compactMap(\.layoutNode) where nodesStartingWith.contains(node.kind.syntaxType.description.first!) { - let documentationSections = [ - node.documentation, - node.grammar, - node.containedIn, - ] - let documentation = - documentationSections - .filter { !$0.isEmpty } - .map { [$0] } - .joined(separator: [Trivia.newline, Trivia.docLineComment("///"), Trivia.newline]) - .reduce(Trivia(), +) - // We are actually handling this node now try! StructDeclSyntax( """ // MARK: - \(node.kind.syntaxType) - \(documentation) + \(SwiftSyntax.Trivia(joining: [node.documentation, node.grammar, node.containedIn])) \(node.node.apiAttributes())\ public struct \(node.kind.syntaxType): \(node.baseType.syntaxBaseName)Protocol, SyntaxHashable, \(node.base.leafProtocolType) """ diff --git a/Sources/SwiftSyntax/generated/SyntaxTraits.swift b/Sources/SwiftSyntax/generated/SyntaxTraits.swift index bd7c55bdf20..d9bb2a2bf18 100644 --- a/Sources/SwiftSyntax/generated/SyntaxTraits.swift +++ b/Sources/SwiftSyntax/generated/SyntaxTraits.swift @@ -16,11 +16,17 @@ public protocol BracedSyntax: SyntaxProtocol { + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `{`. var leftBrace: TokenSyntax { get set } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `}`. var rightBrace: TokenSyntax { get set @@ -121,6 +127,11 @@ public protocol EffectSpecifiersSyntax: SyntaxProtocol { set } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `async` + /// - `reasync` var asyncSpecifier: TokenSyntax? { get set @@ -131,6 +142,11 @@ public protocol EffectSpecifiersSyntax: SyntaxProtocol { set } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `throws` + /// - `rethrows` var throwsSpecifier: TokenSyntax? { get set @@ -173,11 +189,17 @@ public extension SyntaxProtocol { public protocol FreestandingMacroExpansionSyntax: SyntaxProtocol { + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `#`. var pound: TokenSyntax { get set } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. var macroName: TokenSyntax { get set @@ -188,6 +210,9 @@ public protocol FreestandingMacroExpansionSyntax: SyntaxProtocol { set } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `(`. var leftParen: TokenSyntax? { get set @@ -198,6 +223,9 @@ public protocol FreestandingMacroExpansionSyntax: SyntaxProtocol { set } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `)`. var rightParen: TokenSyntax? { get set @@ -245,6 +273,9 @@ public extension SyntaxProtocol { public protocol NamedDeclSyntax: SyntaxProtocol { + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. var name: TokenSyntax { get set @@ -285,6 +316,10 @@ public extension SyntaxProtocol { /// See the types conforming to this protocol for examples of where missing nodes can occur. public protocol MissingNodeSyntax: SyntaxProtocol { /// A placeholder, i.e. `<#placeholder#>`, that can be inserted into the source code to represent the missing node. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. var placeholder: TokenSyntax { get set @@ -322,11 +357,17 @@ public extension SyntaxProtocol { public protocol ParenthesizedSyntax: SyntaxProtocol { + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `(`. var leftParen: TokenSyntax { get set } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `)`. var rightParen: TokenSyntax { get set @@ -558,6 +599,9 @@ public extension SyntaxProtocol { public protocol WithTrailingCommaSyntax: SyntaxProtocol { + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. var trailingComma: TokenSyntax? { get set diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesAB.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesAB.swift index 796d77d69ef..9d12ec4da42 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesAB.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesAB.swift @@ -16,9 +16,9 @@ /// ### Children /// -/// - `leftBrace`: `'{'` +/// - `leftBrace`: `{` /// - `accessors`: (``AccessorDeclListSyntax`` | ``CodeBlockItemListSyntax``) -/// - `rightBrace`: `'}'` +/// - `rightBrace`: `}` /// /// ### Contained in /// @@ -128,6 +128,9 @@ public struct AccessorBlockSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNo } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `{`. public var leftBrace: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -164,6 +167,9 @@ public struct AccessorBlockSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNo } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `}`. public var rightBrace: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -201,7 +207,7 @@ public struct AccessorBlockSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNo /// /// - `attributes`: ``AttributeListSyntax`` /// - `modifier`: ``DeclModifierSyntax``? -/// - `accessorSpecifier`: (`'get'` | `'set'` | `'didSet'` | `'willSet'` | `'unsafeAddress'` | `'addressWithOwner'` | `'addressWithNativeOwner'` | `'unsafeMutableAddress'` | `'mutableAddressWithOwner'` | `'mutableAddressWithNativeOwner'` | `'_read'` | `'_modify'` | `'init'`) +/// - `accessorSpecifier`: (`get` | `set` | `didSet` | `willSet` | `unsafeAddress` | `addressWithOwner` | `addressWithNativeOwner` | `unsafeMutableAddress` | `mutableAddressWithOwner` | `mutableAddressWithNativeOwner` | `_read` | `_modify` | `init`) /// - `parameters`: ``AccessorParametersSyntax``? /// - `effectSpecifiers`: ``AccessorEffectSpecifiersSyntax``? /// - `body`: ``CodeBlockSyntax``? @@ -356,6 +362,22 @@ public struct AccessorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `get` + /// - `set` + /// - `didSet` + /// - `willSet` + /// - `unsafeAddress` + /// - `addressWithOwner` + /// - `addressWithNativeOwner` + /// - `unsafeMutableAddress` + /// - `mutableAddressWithOwner` + /// - `mutableAddressWithNativeOwner` + /// - `_read` + /// - `_modify` + /// - `init` public var accessorSpecifier: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -451,8 +473,8 @@ public struct AccessorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS /// ### Children /// -/// - `asyncSpecifier`: `'async'`? -/// - `throwsSpecifier`: `'throws'`? +/// - `asyncSpecifier`: `async`? +/// - `throwsSpecifier`: `throws`? /// /// ### Contained in /// @@ -517,6 +539,9 @@ public struct AccessorEffectSpecifiersSyntax: SyntaxProtocol, SyntaxHashable, _L } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `async`. public var asyncSpecifier: TokenSyntax? { get { return Syntax(self).child(at: 1)?.cast(TokenSyntax.self) @@ -535,6 +560,9 @@ public struct AccessorEffectSpecifiersSyntax: SyntaxProtocol, SyntaxHashable, _L } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `throws`. public var throwsSpecifier: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -568,9 +596,9 @@ public struct AccessorEffectSpecifiersSyntax: SyntaxProtocol, SyntaxHashable, _L /// ### Children /// -/// - `leftParen`: `'('` +/// - `leftParen`: `(` /// - `name`: `` -/// - `rightParen`: `')'` +/// - `rightParen`: `)` /// /// ### Contained in /// @@ -641,6 +669,9 @@ public struct AccessorParametersSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `(`. public var leftParen: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -659,6 +690,9 @@ public struct AccessorParametersSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var name: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -677,6 +711,9 @@ public struct AccessorParametersSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `)`. public var rightParen: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -714,7 +751,7 @@ public struct AccessorParametersSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn /// /// - `attributes`: ``AttributeListSyntax`` /// - `modifiers`: ``DeclModifierListSyntax`` -/// - `actorKeyword`: `'actor'` +/// - `actorKeyword`: `actor` /// - `name`: `` /// - `genericParameterClause`: ``GenericParameterClauseSyntax``? /// - `inheritanceClause`: ``InheritanceClauseSyntax``? @@ -908,6 +945,9 @@ public struct ActorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `actor`. public var actorKeyword: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -926,6 +966,9 @@ public struct ActorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var name: TokenSyntax { get { return Syntax(self).child(at: 7)!.cast(TokenSyntax.self) @@ -1046,7 +1089,7 @@ public struct ActorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt /// ### Children /// /// - `expression`: ``ExprSyntax`` -/// - `trailingComma`: `','`? +/// - `trailingComma`: `,`? /// /// ### Contained in /// @@ -1129,6 +1172,9 @@ public struct ArrayElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var trailingComma: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -1162,9 +1208,9 @@ public struct ArrayElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod /// ### Children /// -/// - `leftSquare`: `'['` +/// - `leftSquare`: `[` /// - `elements`: ``ArrayElementListSyntax`` -/// - `rightSquare`: `']'` +/// - `rightSquare`: `]` public struct ArrayExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -1231,6 +1277,9 @@ public struct ArrayExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `[`. public var leftSquare: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -1294,6 +1343,9 @@ public struct ArrayExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `]`. public var rightSquare: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -1329,9 +1381,9 @@ public struct ArrayExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt /// ### Children /// -/// - `leftSquare`: `'['` +/// - `leftSquare`: `[` /// - `element`: ``TypeSyntax`` -/// - `rightSquare`: `']'` +/// - `rightSquare`: `]` public struct ArrayTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -1398,6 +1450,9 @@ public struct ArrayTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `[`. public var leftSquare: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -1434,6 +1489,9 @@ public struct ArrayTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `]`. public var rightSquare: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -1470,7 +1528,7 @@ public struct ArrayTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSynt /// ### Children /// /// - `effectSpecifiers`: ``TypeEffectSpecifiersSyntax``? -/// - `arrow`: `'->'` +/// - `arrow`: `->` public struct ArrowExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -1549,6 +1607,9 @@ public struct ArrowExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `->`. public var arrow: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -1583,8 +1644,8 @@ public struct ArrowExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt /// ### Children /// /// - `expression`: ``ExprSyntax`` -/// - `asKeyword`: `'as'` -/// - `questionOrExclamationMark`: (`'?'` | `'!'`)? +/// - `asKeyword`: `as` +/// - `questionOrExclamationMark`: (`?` | `!`)? /// - `type`: ``TypeSyntax`` public struct AsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -1676,6 +1737,9 @@ public struct AsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxN } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `as`. public var asKeyword: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -1694,6 +1758,11 @@ public struct AsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxN } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `?` + /// - `!` public var questionOrExclamationMark: TokenSyntax? { get { return Syntax(self).child(at: 5)?.cast(TokenSyntax.self) @@ -1749,7 +1818,7 @@ public struct AsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxN /// ### Children /// -/// - `equal`: `'='` +/// - `equal`: `=` public struct AssignmentExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -1796,6 +1865,9 @@ public struct AssignmentExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExp } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `=`. public var equal: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -1851,7 +1923,7 @@ public struct AssignmentExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExp /// /// - `attributes`: ``AttributeListSyntax`` /// - `modifiers`: ``DeclModifierListSyntax`` -/// - `associatedtypeKeyword`: `'associatedtype'` +/// - `associatedtypeKeyword`: `associatedtype` /// - `name`: `` /// - `inheritanceClause`: ``InheritanceClauseSyntax``? /// - `initializer`: ``TypeInitializerClauseSyntax``? @@ -2046,6 +2118,10 @@ public struct AssociatedTypeDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Lea } /// The `associatedtype` keyword for this declaration. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `associatedtype`. public var associatedtypeKeyword: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -2065,6 +2141,10 @@ public struct AssociatedTypeDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Lea } /// The name of this associated type. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var name: TokenSyntax { get { return Syntax(self).child(at: 7)!.cast(TokenSyntax.self) @@ -2167,11 +2247,11 @@ public struct AssociatedTypeDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Lea /// /// ### Children /// -/// - `atSign`: `'@'` +/// - `atSign`: `@` /// - `attributeName`: ``TypeSyntax`` -/// - `leftParen`: `'('`? +/// - `leftParen`: `(`? /// - `arguments`: (``LabeledExprListSyntax`` | ``TokenSyntax`` | ``StringLiteralExprSyntax`` | ``AvailabilityArgumentListSyntax`` | ``SpecializeAttributeArgumentListSyntax`` | ``ObjCSelectorPieceListSyntax`` | ``ImplementsAttributeArgumentsSyntax`` | ``DifferentiableAttributeArgumentsSyntax`` | ``DerivativeAttributeArgumentsSyntax`` | ``BackDeployedAttributeArgumentsSyntax`` | ``ConventionAttributeArgumentsSyntax`` | ``ConventionWitnessMethodAttributeArgumentsSyntax`` | ``OpaqueReturnTypeOfAttributeArgumentsSyntax`` | ``ExposeAttributeArgumentsSyntax`` | ``OriginallyDefinedInAttributeArgumentsSyntax`` | ``UnderscorePrivateAttributeArgumentsSyntax`` | ``DynamicReplacementAttributeArgumentsSyntax`` | ``UnavailableFromAsyncAttributeArgumentsSyntax`` | ``EffectsAttributeArgumentListSyntax`` | ``DocumentationAttributeArgumentListSyntax``)? -/// - `rightParen`: `')'`? +/// - `rightParen`: `)`? /// /// ### Contained in /// @@ -2518,6 +2598,10 @@ public struct AttributeSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodePr } /// The `@` sign. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `@`. public var atSign: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -2556,6 +2640,10 @@ public struct AttributeSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodePr } /// If the attribute takes arguments, the opening parenthesis. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `(`. public var leftParen: TokenSyntax? { get { return Syntax(self).child(at: 5)?.cast(TokenSyntax.self) @@ -2597,6 +2685,10 @@ public struct AttributeSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodePr } /// If the attribute takes arguments, the closing parenthesis. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `)`. public var rightParen: TokenSyntax? { get { return Syntax(self).child(at: 9)?.cast(TokenSyntax.self) @@ -2636,7 +2728,7 @@ public struct AttributeSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodePr /// ### Children /// -/// - `specifier`: (`'inout'` | `'__shared'` | `'__owned'` | `'isolated'` | `'_const'` | `'borrowing'` | `'consuming'`)? +/// - `specifier`: (`inout` | `__shared` | `__owned` | `isolated` | `_const` | `borrowing` | `consuming`)? /// - `attributes`: ``AttributeListSyntax`` /// - `baseType`: ``TypeSyntax`` public struct AttributedTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSyntaxNodeProtocol { @@ -2705,6 +2797,16 @@ public struct AttributedTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `inout` + /// - `__shared` + /// - `__owned` + /// - `isolated` + /// - `_const` + /// - `borrowing` + /// - `consuming` public var specifier: TokenSyntax? { get { return Syntax(self).child(at: 1)?.cast(TokenSyntax.self) @@ -2806,7 +2908,7 @@ public struct AttributedTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp /// ### Children /// /// - `argument`: ((`` | ``) | ``PlatformVersionSyntax`` | ``AvailabilityLabeledArgumentSyntax``) -/// - `trailingComma`: `','`? +/// - `trailingComma`: `,`? /// /// ### Contained in /// @@ -2942,6 +3044,10 @@ public struct AvailabilityArgumentSyntax: SyntaxProtocol, SyntaxHashable, _LeafS } /// A trailing comma if the argument is followed by another argument + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var trailingComma: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -2975,10 +3081,10 @@ public struct AvailabilityArgumentSyntax: SyntaxProtocol, SyntaxHashable, _LeafS /// ### Children /// -/// - `availabilityKeyword`: (`'#available'` | `'#unavailable'`) -/// - `leftParen`: `'('` +/// - `availabilityKeyword`: (`#available` | `#unavailable`) +/// - `leftParen`: `(` /// - `availabilityArguments`: ``AvailabilityArgumentListSyntax`` -/// - `rightParen`: `')'` +/// - `rightParen`: `)` /// /// ### Contained in /// @@ -3055,6 +3161,11 @@ public struct AvailabilityConditionSyntax: SyntaxProtocol, SyntaxHashable, _Leaf } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `#available` + /// - `#unavailable` public var availabilityKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3073,6 +3184,9 @@ public struct AvailabilityConditionSyntax: SyntaxProtocol, SyntaxHashable, _Leaf } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `(`. public var leftParen: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -3136,6 +3250,9 @@ public struct AvailabilityConditionSyntax: SyntaxProtocol, SyntaxHashable, _Leaf } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `)`. public var rightParen: TokenSyntax { get { return Syntax(self).child(at: 7)!.cast(TokenSyntax.self) @@ -3175,8 +3292,8 @@ public struct AvailabilityConditionSyntax: SyntaxProtocol, SyntaxHashable, _Leaf /// /// ### Children /// -/// - `label`: (`'message'` | `'renamed'` | `'introduced'` | `'obsoleted'` | `'deprecated'`) -/// - `colon`: `':'` +/// - `label`: (`message` | `renamed` | `introduced` | `obsoleted` | `deprecated`) +/// - `colon`: `:` /// - `value`: (``SimpleStringLiteralExprSyntax`` | ``VersionTupleSyntax``) /// /// ### Contained in @@ -3290,6 +3407,15 @@ public struct AvailabilityLabeledArgumentSyntax: SyntaxProtocol, SyntaxHashable, } /// The label of the argument + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `message` + /// - `renamed` + /// - `introduced` + /// - `obsoleted` + /// - `deprecated` public var label: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3309,6 +3435,10 @@ public struct AvailabilityLabeledArgumentSyntax: SyntaxProtocol, SyntaxHashable, } /// The colon separating label and value + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -3363,7 +3493,7 @@ public struct AvailabilityLabeledArgumentSyntax: SyntaxProtocol, SyntaxHashable, /// ### Children /// -/// - `awaitKeyword`: `'await'` +/// - `awaitKeyword`: `await` /// - `expression`: ``ExprSyntax`` public struct AwaitExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -3425,6 +3555,9 @@ public struct AwaitExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `await`. public var awaitKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3478,8 +3611,8 @@ public struct AwaitExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt /// /// ### Children /// -/// - `beforeLabel`: `'before'` -/// - `colon`: `':'` +/// - `beforeLabel`: `before` +/// - `colon`: `:` /// - `platforms`: ``PlatformVersionItemListSyntax`` /// /// ### Contained in @@ -3555,6 +3688,10 @@ public struct BackDeployedAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashab } /// The "before" label. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `before`. public var beforeLabel: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3574,6 +3711,10 @@ public struct BackDeployedAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashab } /// The colon separating "before" and the parameter list. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -3702,6 +3843,9 @@ public struct BinaryOperatorExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var `operator`: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3729,7 +3873,7 @@ public struct BinaryOperatorExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea /// ### Children /// -/// - `literal`: (`'true'` | `'false'`) +/// - `literal`: (`true` | `false`) public struct BooleanLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -3776,6 +3920,11 @@ public struct BooleanLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `true` + /// - `false` public var literal: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3803,7 +3952,7 @@ public struct BooleanLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea /// ### Children /// -/// - `borrowKeyword`: `'_borrow'` +/// - `borrowKeyword`: `_borrow` /// - `expression`: ``ExprSyntax`` public struct BorrowExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -3865,6 +4014,9 @@ public struct BorrowExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyn } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `_borrow`. public var borrowKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3916,7 +4068,7 @@ public struct BorrowExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyn /// ### Children /// -/// - `breakKeyword`: `'break'` +/// - `breakKeyword`: `break` /// - `label`: ``? public struct BreakStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -3978,6 +4130,9 @@ public struct BreakStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `break`. public var breakKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3996,6 +4151,9 @@ public struct BreakStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var label: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesC.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesC.swift index cb998ff9392..74567a38dda 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesC.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesC.swift @@ -16,11 +16,11 @@ /// ### Children /// -/// - `canImportKeyword`: `'canImport'` -/// - `leftParen`: `'('` +/// - `canImportKeyword`: `canImport` +/// - `leftParen`: `(` /// - `importPath`: `` /// - `versionInfo`: ``CanImportVersionInfoSyntax``? -/// - `rightParen`: `')'` +/// - `rightParen`: `)` public struct CanImportExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -99,6 +99,9 @@ public struct CanImportExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExpr } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `canImport`. public var canImportKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -117,6 +120,9 @@ public struct CanImportExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExpr } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `(`. public var leftParen: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -135,6 +141,9 @@ public struct CanImportExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExpr } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var importPath: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -171,6 +180,9 @@ public struct CanImportExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExpr } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `)`. public var rightParen: TokenSyntax { get { return Syntax(self).child(at: 9)!.cast(TokenSyntax.self) @@ -210,9 +222,9 @@ public struct CanImportExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExpr /// ### Children /// -/// - `comma`: `','` -/// - `label`: (`'_version'` | `'_underlyingVersion'`) -/// - `colon`: `':'` +/// - `comma`: `,` +/// - `label`: (`_version` | `_underlyingVersion`) +/// - `colon`: `:` /// - `version`: ``VersionTupleSyntax`` /// /// ### Contained in @@ -290,6 +302,9 @@ public struct CanImportVersionInfoSyntax: ExprSyntaxProtocol, SyntaxHashable, _L } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var comma: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -308,6 +323,11 @@ public struct CanImportVersionInfoSyntax: ExprSyntaxProtocol, SyntaxHashable, _L } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `_version` + /// - `_underlyingVersion` public var label: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -326,6 +346,9 @@ public struct CanImportVersionInfoSyntax: ExprSyntaxProtocol, SyntaxHashable, _L } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -381,7 +404,7 @@ public struct CanImportVersionInfoSyntax: ExprSyntaxProtocol, SyntaxHashable, _L /// ### Children /// -/// - `catchKeyword`: `'catch'` +/// - `catchKeyword`: `catch` /// - `catchItems`: ``CatchItemListSyntax`` /// - `body`: ``CodeBlockSyntax`` /// @@ -454,6 +477,9 @@ public struct CatchClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `catch`. public var catchKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -554,7 +580,7 @@ public struct CatchClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode /// /// - `pattern`: ``PatternSyntax``? /// - `whereClause`: ``WhereClauseSyntax``? -/// - `trailingComma`: `','`? +/// - `trailingComma`: `,`? /// /// ### Contained in /// @@ -661,6 +687,9 @@ public struct CatchItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodePr } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var trailingComma: TokenSyntax? { get { return Syntax(self).child(at: 5)?.cast(TokenSyntax.self) @@ -722,7 +751,7 @@ public struct CatchItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodePr /// /// - `attributes`: ``AttributeListSyntax`` /// - `modifiers`: ``DeclModifierListSyntax`` -/// - `classKeyword`: `'class'` +/// - `classKeyword`: `class` /// - `name`: `` /// - `genericParameterClause`: ``GenericParameterClauseSyntax``? /// - `inheritanceClause`: ``InheritanceClauseSyntax``? @@ -925,6 +954,10 @@ public struct ClassDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt } /// The `class` keyword for this declaration. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `class`. public var classKeyword: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -944,6 +977,10 @@ public struct ClassDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt } /// The name of the class. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var name: TokenSyntax { get { return Syntax(self).child(at: 7)!.cast(TokenSyntax.self) @@ -1065,7 +1102,7 @@ public struct ClassDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt /// ### Children /// -/// - `classKeyword`: `'class'` +/// - `classKeyword`: `class` public struct ClassRestrictionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -1112,6 +1149,9 @@ public struct ClassRestrictionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _L } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `class`. public var classKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -1139,9 +1179,9 @@ public struct ClassRestrictionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _L /// ### Children /// -/// - `leftSquare`: `'['` +/// - `leftSquare`: `[` /// - `items`: ``ClosureCaptureListSyntax`` -/// - `rightSquare`: `']'` +/// - `rightSquare`: `]` /// /// ### Contained in /// @@ -1212,6 +1252,9 @@ public struct ClosureCaptureClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafS } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `[`. public var leftSquare: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -1275,6 +1318,9 @@ public struct ClosureCaptureClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafS } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `]`. public var rightSquare: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -1310,10 +1356,10 @@ public struct ClosureCaptureClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafS /// ### Children /// -/// - `specifier`: (`'weak'` | `'unowned'`) -/// - `leftParen`: `'('`? -/// - `detail`: (`'safe'` | `'unsafe'`)? -/// - `rightParen`: `')'`? +/// - `specifier`: (`weak` | `unowned`) +/// - `leftParen`: `(`? +/// - `detail`: (`safe` | `unsafe`)? +/// - `rightParen`: `)`? /// /// ### Contained in /// @@ -1390,6 +1436,11 @@ public struct ClosureCaptureSpecifierSyntax: SyntaxProtocol, SyntaxHashable, _Le } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `weak` + /// - `unowned` public var specifier: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -1408,6 +1459,9 @@ public struct ClosureCaptureSpecifierSyntax: SyntaxProtocol, SyntaxHashable, _Le } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `(`. public var leftParen: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -1426,6 +1480,11 @@ public struct ClosureCaptureSpecifierSyntax: SyntaxProtocol, SyntaxHashable, _Le } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `safe` + /// - `unsafe` public var detail: TokenSyntax? { get { return Syntax(self).child(at: 5)?.cast(TokenSyntax.self) @@ -1444,6 +1503,9 @@ public struct ClosureCaptureSpecifierSyntax: SyntaxProtocol, SyntaxHashable, _Le } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `)`. public var rightParen: TokenSyntax? { get { return Syntax(self).child(at: 7)?.cast(TokenSyntax.self) @@ -1483,9 +1545,9 @@ public struct ClosureCaptureSpecifierSyntax: SyntaxProtocol, SyntaxHashable, _Le /// /// - `specifier`: ``ClosureCaptureSpecifierSyntax``? /// - `name`: ``? -/// - `equal`: `'='`? +/// - `equal`: `=`? /// - `expression`: ``ExprSyntax`` -/// - `trailingComma`: `','`? +/// - `trailingComma`: `,`? /// /// ### Contained in /// @@ -1586,6 +1648,9 @@ public struct ClosureCaptureSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var name: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -1604,6 +1669,9 @@ public struct ClosureCaptureSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `=`. public var equal: TokenSyntax? { get { return Syntax(self).child(at: 5)?.cast(TokenSyntax.self) @@ -1640,6 +1708,9 @@ public struct ClosureCaptureSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var trailingComma: TokenSyntax? { get { return Syntax(self).child(at: 9)?.cast(TokenSyntax.self) @@ -1679,10 +1750,10 @@ public struct ClosureCaptureSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN /// ### Children /// -/// - `leftBrace`: `'{'` +/// - `leftBrace`: `{` /// - `signature`: ``ClosureSignatureSyntax``? /// - `statements`: ``CodeBlockItemListSyntax`` -/// - `rightBrace`: `'}'` +/// - `rightBrace`: `}` /// /// ### Contained in /// @@ -1763,6 +1834,9 @@ public struct ClosureExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `{`. public var leftBrace: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -1844,6 +1918,9 @@ public struct ClosureExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `}`. public var rightBrace: TokenSyntax { get { return Syntax(self).child(at: 7)!.cast(TokenSyntax.self) @@ -1881,9 +1958,9 @@ public struct ClosureExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy /// ### Children /// -/// - `leftParen`: `'('` +/// - `leftParen`: `(` /// - `parameters`: ``ClosureParameterListSyntax`` -/// - `rightParen`: `')'` +/// - `rightParen`: `)` /// /// ### Contained in /// @@ -1958,6 +2035,10 @@ public struct ClosureParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Lea } /// The '(' to open the parameter clause. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `(`. public var leftParen: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -2023,6 +2104,10 @@ public struct ClosureParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Lea } /// The ')' to close the parameter clause. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `)`. public var rightParen: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -2060,12 +2145,12 @@ public struct ClosureParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Lea /// /// - `attributes`: ``AttributeListSyntax`` /// - `modifiers`: ``DeclModifierListSyntax`` -/// - `firstName`: (`` | `'_'`) -/// - `secondName`: (`` | `'_'`)? -/// - `colon`: `':'`? +/// - `firstName`: (`` | `_`) +/// - `secondName`: (`` | `_`)? +/// - `colon`: `:`? /// - `type`: ``TypeSyntax``? -/// - `ellipsis`: `'...'`? -/// - `trailingComma`: `','`? +/// - `ellipsis`: `...`? +/// - `trailingComma`: `,`? /// /// ### Contained in /// @@ -2263,6 +2348,12 @@ public struct ClosureParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta } /// The label of this parameter that will be used when the closure is called. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `` + /// - `_` public var firstName: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -2282,6 +2373,12 @@ public struct ClosureParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta } /// If this is specified, it is the name by which the parameter can be referenced inside the closure body. If it is `nil`, the closure parameter is referenced by the first name. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `` + /// - `_` public var secondName: TokenSyntax? { get { return Syntax(self).child(at: 7)?.cast(TokenSyntax.self) @@ -2301,6 +2398,10 @@ public struct ClosureParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta } /// The colon separating the parameter's name and type. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax? { get { return Syntax(self).child(at: 9)?.cast(TokenSyntax.self) @@ -2339,6 +2440,10 @@ public struct ClosureParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta } /// If the parameter is variadic, `...` to indicate that. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `...`. public var ellipsis: TokenSyntax? { get { return Syntax(self).child(at: 13)?.cast(TokenSyntax.self) @@ -2358,6 +2463,10 @@ public struct ClosureParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta } /// If the parameter is followed by another parameter, the comma separating them. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var trailingComma: TokenSyntax? { get { return Syntax(self).child(at: 15)?.cast(TokenSyntax.self) @@ -2403,8 +2512,8 @@ public struct ClosureParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta /// ### Children /// -/// - `name`: (`` | `'_'`) -/// - `trailingComma`: `','`? +/// - `name`: (`` | `_`) +/// - `trailingComma`: `,`? /// /// ### Contained in /// @@ -2469,6 +2578,11 @@ public struct ClosureShorthandParameterSyntax: SyntaxProtocol, SyntaxHashable, _ } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `` + /// - `_` public var name: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -2487,6 +2601,9 @@ public struct ClosureShorthandParameterSyntax: SyntaxProtocol, SyntaxHashable, _ } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var trailingComma: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -2525,7 +2642,7 @@ public struct ClosureShorthandParameterSyntax: SyntaxProtocol, SyntaxHashable, _ /// - `parameterClause`: (``ClosureShorthandParameterListSyntax`` | ``ClosureParameterClauseSyntax``)? /// - `effectSpecifiers`: ``TypeEffectSpecifiersSyntax``? /// - `returnClause`: ``ReturnClauseSyntax``? -/// - `inKeyword`: `'in'` +/// - `inKeyword`: `in` /// /// ### Contained in /// @@ -2769,6 +2886,9 @@ public struct ClosureSignatureSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `in`. public var inKeyword: TokenSyntax { get { return Syntax(self).child(at: 11)!.cast(TokenSyntax.self) @@ -2813,7 +2933,7 @@ public struct ClosureSignatureSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta /// ### Children /// /// - `item`: (``DeclSyntax`` | ``StmtSyntax`` | ``ExprSyntax``) -/// - `semicolon`: `';'`? +/// - `semicolon`: `;`? /// /// ### Contained in /// @@ -2949,6 +3069,10 @@ public struct CodeBlockItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNo } /// If present, the trailing semicolon at the end of the item. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `;`. public var semicolon: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -2982,9 +3106,9 @@ public struct CodeBlockItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNo /// ### Children /// -/// - `leftBrace`: `'{'` +/// - `leftBrace`: `{` /// - `statements`: ``CodeBlockItemListSyntax`` -/// - `rightBrace`: `'}'` +/// - `rightBrace`: `}` /// /// ### Contained in /// @@ -3067,6 +3191,9 @@ public struct CodeBlockSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodePr } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `{`. public var leftBrace: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3130,6 +3257,9 @@ public struct CodeBlockSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodePr } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `}`. public var rightBrace: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -3384,7 +3514,7 @@ public struct CompositionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTy /// ### Children /// /// - `condition`: (``ExprSyntax`` | ``AvailabilityConditionSyntax`` | ``MatchingPatternConditionSyntax`` | ``OptionalBindingConditionSyntax``) -/// - `trailingComma`: `','`? +/// - `trailingComma`: `,`? /// /// ### Contained in /// @@ -3532,6 +3662,9 @@ public struct ConditionElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var trailingComma: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -3566,7 +3699,7 @@ public struct ConditionElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta /// ### Children /// /// - `leftType`: ``TypeSyntax`` -/// - `colon`: `':'` +/// - `colon`: `:` /// - `rightType`: ``TypeSyntax`` /// /// ### Contained in @@ -3656,6 +3789,9 @@ public struct ConformanceRequirementSyntax: SyntaxProtocol, SyntaxHashable, _Lea } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -3709,7 +3845,7 @@ public struct ConformanceRequirementSyntax: SyntaxProtocol, SyntaxHashable, _Lea /// ### Children /// -/// - `consumeKeyword`: (`'_move'` | `'consume'`) +/// - `consumeKeyword`: (`_move` | `consume`) /// - `expression`: ``ExprSyntax`` public struct ConsumeExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -3771,6 +3907,11 @@ public struct ConsumeExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `_move` + /// - `consume` public var consumeKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3822,7 +3963,7 @@ public struct ConsumeExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy /// ### Children /// -/// - `continueKeyword`: `'continue'` +/// - `continueKeyword`: `continue` /// - `label`: ``? public struct ContinueStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -3884,6 +4025,9 @@ public struct ContinueStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtS } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `continue`. public var continueKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3902,6 +4046,9 @@ public struct ContinueStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtS } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var label: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -3938,9 +4085,9 @@ public struct ContinueStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtS /// ### Children /// /// - `conventionLabel`: `` -/// - `comma`: `','`? -/// - `cTypeLabel`: `'cType'`? -/// - `colon`: `':'`? +/// - `comma`: `,`? +/// - `cTypeLabel`: `cType`? +/// - `colon`: `:`? /// - `cTypeString`: ``StringLiteralExprSyntax``? /// /// ### Contained in @@ -4026,6 +4173,10 @@ public struct ConventionAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable } /// The convention label. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var conventionLabel: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -4044,6 +4195,9 @@ public struct ConventionAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var comma: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -4062,6 +4216,9 @@ public struct ConventionAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `cType`. public var cTypeLabel: TokenSyntax? { get { return Syntax(self).child(at: 5)?.cast(TokenSyntax.self) @@ -4080,6 +4237,9 @@ public struct ConventionAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax? { get { return Syntax(self).child(at: 7)?.cast(TokenSyntax.self) @@ -4139,8 +4299,8 @@ public struct ConventionAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable /// /// ### Children /// -/// - `witnessMethodLabel`: `'witness_method'` -/// - `colon`: `':'` +/// - `witnessMethodLabel`: `witness_method` +/// - `colon`: `:` /// - `protocolName`: `` /// /// ### Contained in @@ -4212,6 +4372,9 @@ public struct ConventionWitnessMethodAttributeArgumentsSyntax: SyntaxProtocol, S } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `witness_method`. public var witnessMethodLabel: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -4230,6 +4393,9 @@ public struct ConventionWitnessMethodAttributeArgumentsSyntax: SyntaxProtocol, S } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -4248,6 +4414,9 @@ public struct ConventionWitnessMethodAttributeArgumentsSyntax: SyntaxProtocol, S } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var protocolName: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -4283,7 +4452,7 @@ public struct ConventionWitnessMethodAttributeArgumentsSyntax: SyntaxProtocol, S /// ### Children /// -/// - `copyKeyword`: `'copy'` +/// - `copyKeyword`: `copy` /// - `expression`: ``ExprSyntax`` public struct CopyExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -4345,6 +4514,9 @@ public struct CopyExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynta } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `copy`. public var copyKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesD.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesD.swift index d9bdf34420c..87c5469da40 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesD.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesD.swift @@ -16,9 +16,9 @@ /// ### Children /// -/// - `leftParen`: `'('` +/// - `leftParen`: `(` /// - `detail`: `` -/// - `rightParen`: `')'` +/// - `rightParen`: `)` /// /// ### Contained in /// @@ -89,6 +89,9 @@ public struct DeclModifierDetailSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `(`. public var leftParen: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -107,6 +110,9 @@ public struct DeclModifierDetailSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var detail: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -125,6 +131,9 @@ public struct DeclModifierDetailSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `)`. public var rightParen: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -160,7 +169,7 @@ public struct DeclModifierDetailSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn /// ### Children /// -/// - `name`: (`'__consuming'` | `'__setter_access'` | `'_const'` | `'_local'` | `'actor'` | `'async'` | `'borrowing'` | `'class'` | `'consuming'` | `'convenience'` | `'distributed'` | `'dynamic'` | `'fileprivate'` | `'final'` | `'indirect'` | `'infix'` | `'internal'` | `'isolated'` | `'lazy'` | `'mutating'` | `'nonisolated'` | `'nonmutating'` | `'open'` | `'optional'` | `'override'` | `'package'` | `'postfix'` | `'prefix'` | `'private'` | `'public'` | `'reasync'` | `'required'` | `'static'` | `'unowned'` | `'weak'`) +/// - `name`: (`__consuming` | `__setter_access` | `_const` | `_local` | `actor` | `async` | `borrowing` | `class` | `consuming` | `convenience` | `distributed` | `dynamic` | `fileprivate` | `final` | `indirect` | `infix` | `internal` | `isolated` | `lazy` | `mutating` | `nonisolated` | `nonmutating` | `open` | `optional` | `override` | `package` | `postfix` | `prefix` | `private` | `public` | `reasync` | `required` | `static` | `unowned` | `weak`) /// - `detail`: ``DeclModifierDetailSyntax``? /// /// ### Contained in @@ -227,6 +236,44 @@ public struct DeclModifierSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `__consuming` + /// - `__setter_access` + /// - `_const` + /// - `_local` + /// - `actor` + /// - `async` + /// - `borrowing` + /// - `class` + /// - `consuming` + /// - `convenience` + /// - `distributed` + /// - `dynamic` + /// - `fileprivate` + /// - `final` + /// - `indirect` + /// - `infix` + /// - `internal` + /// - `isolated` + /// - `lazy` + /// - `mutating` + /// - `nonisolated` + /// - `nonmutating` + /// - `open` + /// - `optional` + /// - `override` + /// - `package` + /// - `postfix` + /// - `prefix` + /// - `private` + /// - `public` + /// - `reasync` + /// - `required` + /// - `static` + /// - `unowned` + /// - `weak` public var name: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -279,7 +326,7 @@ public struct DeclModifierSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod /// ### Children /// /// - `name`: ``TokenSyntax`` -/// - `colon`: `':'` +/// - `colon`: `:` /// /// ### Contained in /// @@ -362,6 +409,9 @@ public struct DeclNameArgumentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -395,9 +445,9 @@ public struct DeclNameArgumentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta /// ### Children /// -/// - `leftParen`: `'('` +/// - `leftParen`: `(` /// - `arguments`: ``DeclNameArgumentListSyntax`` -/// - `rightParen`: `')'` +/// - `rightParen`: `)` /// /// ### Contained in /// @@ -468,6 +518,9 @@ public struct DeclNameArgumentsSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `(`. public var leftParen: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -531,6 +584,9 @@ public struct DeclNameArgumentsSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `)`. public var rightParen: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -566,7 +622,7 @@ public struct DeclNameArgumentsSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt /// ### Children /// -/// - `baseName`: (`` | `'self'` | `'Self'` | `'init'` | `` | `` | ``) +/// - `baseName`: (`` | `self` | `Self` | `init` | `` | `` | ``) /// - `argumentNames`: ``DeclNameArgumentsSyntax``? /// /// ### Contained in @@ -636,6 +692,16 @@ public struct DeclReferenceExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `` + /// - `self` + /// - `Self` + /// - `init` + /// - `` + /// - `` + /// - `` public var baseName: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -687,7 +753,7 @@ public struct DeclReferenceExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf /// ### Children /// -/// - `deferKeyword`: `'defer'` +/// - `deferKeyword`: `defer` /// - `body`: ``CodeBlockSyntax`` public struct DeferStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -749,6 +815,9 @@ public struct DeferStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `defer`. public var deferKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -811,7 +880,7 @@ public struct DeferStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt /// /// - `attributes`: ``AttributeListSyntax`` /// - `modifiers`: ``DeclModifierListSyntax`` -/// - `deinitKeyword`: `'deinit'` +/// - `deinitKeyword`: `deinit` /// - `effectSpecifiers`: ``DeinitializerEffectSpecifiersSyntax``? /// - `body`: ``CodeBlockSyntax``? public struct DeinitializerDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyntaxNodeProtocol { @@ -989,6 +1058,10 @@ public struct DeinitializerDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Leaf } /// The deinit keyword. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `deinit`. public var deinitKeyword: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -1065,7 +1138,7 @@ public struct DeinitializerDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Leaf /// ### Children /// -/// - `asyncSpecifier`: `'async'`? +/// - `asyncSpecifier`: `async`? /// /// ### Contained in /// @@ -1116,6 +1189,9 @@ public struct DeinitializerEffectSpecifiersSyntax: SyntaxProtocol, SyntaxHashabl } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `async`. public var asyncSpecifier: TokenSyntax? { get { return Syntax(self).child(at: 1)?.cast(TokenSyntax.self) @@ -1145,12 +1221,12 @@ public struct DeinitializerEffectSpecifiersSyntax: SyntaxProtocol, SyntaxHashabl /// /// ### Children /// -/// - `ofLabel`: `'of'` -/// - `colon`: `':'` +/// - `ofLabel`: `of` +/// - `colon`: `:` /// - `originalDeclName`: ``ExprSyntax`` -/// - `period`: `'.'`? -/// - `accessorSpecifier`: (`'get'` | `'set'`)? -/// - `comma`: `','`? +/// - `period`: `.`? +/// - `accessorSpecifier`: (`get` | `set`)? +/// - `comma`: `,`? /// - `arguments`: ``DifferentiabilityWithRespectToArgumentSyntax``? /// /// ### Contained in @@ -1252,6 +1328,10 @@ public struct DerivativeAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable } /// The "of" label. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `of`. public var ofLabel: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -1271,6 +1351,10 @@ public struct DerivativeAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable } /// The colon separating the "of" label and the original declaration name. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -1309,6 +1393,10 @@ public struct DerivativeAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable } /// The period separating the original declaration name and the accessor name. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `.`. public var period: TokenSyntax? { get { return Syntax(self).child(at: 7)?.cast(TokenSyntax.self) @@ -1328,6 +1416,12 @@ public struct DerivativeAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable } /// The accessor name. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `get` + /// - `set` public var accessorSpecifier: TokenSyntax? { get { return Syntax(self).child(at: 9)?.cast(TokenSyntax.self) @@ -1346,6 +1440,9 @@ public struct DerivativeAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var comma: TokenSyntax? { get { return Syntax(self).child(at: 11)?.cast(TokenSyntax.self) @@ -1407,7 +1504,7 @@ public struct DerivativeAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable /// ### Children /// -/// - `leadingComma`: `','` +/// - `leadingComma`: `,` /// - `name`: ``TokenSyntax`` /// /// ### Contained in @@ -1473,6 +1570,9 @@ public struct DesignatedTypeSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var leadingComma: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -1525,9 +1625,9 @@ public struct DesignatedTypeSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN /// ### Children /// /// - `key`: ``ExprSyntax`` -/// - `colon`: `':'` +/// - `colon`: `:` /// - `value`: ``ExprSyntax`` -/// - `trailingComma`: `','`? +/// - `trailingComma`: `,`? /// /// ### Contained in /// @@ -1622,6 +1722,9 @@ public struct DictionaryElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -1658,6 +1761,9 @@ public struct DictionaryElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var trailingComma: TokenSyntax? { get { return Syntax(self).child(at: 7)?.cast(TokenSyntax.self) @@ -1695,9 +1801,9 @@ public struct DictionaryElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt /// ### Children /// -/// - `leftSquare`: `'['` -/// - `content`: (`':'` | ``DictionaryElementListSyntax``) -/// - `rightSquare`: `']'` +/// - `leftSquare`: `[` +/// - `content`: (`:` | ``DictionaryElementListSyntax``) +/// - `rightSquare`: `]` public struct DictionaryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxNodeProtocol { public enum Content: SyntaxChildChoices, SyntaxHashable { case `colon`(TokenSyntax) @@ -1802,6 +1908,9 @@ public struct DictionaryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExp } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `[`. public var leftSquare: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -1838,6 +1947,9 @@ public struct DictionaryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExp } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `]`. public var rightSquare: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -1873,11 +1985,11 @@ public struct DictionaryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExp /// ### Children /// -/// - `leftSquare`: `'['` +/// - `leftSquare`: `[` /// - `key`: ``TypeSyntax`` -/// - `colon`: `':'` +/// - `colon`: `:` /// - `value`: ``TypeSyntax`` -/// - `rightSquare`: `']'` +/// - `rightSquare`: `]` public struct DictionaryTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -1956,6 +2068,9 @@ public struct DictionaryTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `[`. public var leftSquare: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -1992,6 +2107,9 @@ public struct DictionaryTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -2028,6 +2146,9 @@ public struct DictionaryTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `]`. public var rightSquare: TokenSyntax { get { return Syntax(self).child(at: 9)!.cast(TokenSyntax.self) @@ -2069,8 +2190,8 @@ public struct DictionaryTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp /// /// ### Children /// -/// - `argument`: (`` | `` | `'self'`) -/// - `trailingComma`: `','`? +/// - `argument`: (`` | `` | `self`) +/// - `trailingComma`: `,`? /// /// ### Contained in /// @@ -2136,6 +2257,12 @@ public struct DifferentiabilityArgumentSyntax: SyntaxProtocol, SyntaxHashable, _ } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `` + /// - `` + /// - `self` public var argument: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -2154,6 +2281,9 @@ public struct DifferentiabilityArgumentSyntax: SyntaxProtocol, SyntaxHashable, _ } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var trailingComma: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -2189,9 +2319,9 @@ public struct DifferentiabilityArgumentSyntax: SyntaxProtocol, SyntaxHashable, _ /// /// ### Children /// -/// - `leftParen`: `'('` +/// - `leftParen`: `(` /// - `arguments`: ``DifferentiabilityArgumentListSyntax`` -/// - `rightParen`: `')'` +/// - `rightParen`: `)` /// /// ### Contained in /// @@ -2263,6 +2393,9 @@ public struct DifferentiabilityArgumentsSyntax: SyntaxProtocol, SyntaxHashable, } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `(`. public var leftParen: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -2327,6 +2460,9 @@ public struct DifferentiabilityArgumentsSyntax: SyntaxProtocol, SyntaxHashable, } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `)`. public var rightParen: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -2364,8 +2500,8 @@ public struct DifferentiabilityArgumentsSyntax: SyntaxProtocol, SyntaxHashable, /// /// ### Children /// -/// - `wrtLabel`: `'wrt'` -/// - `colon`: `':'` +/// - `wrtLabel`: `wrt` +/// - `colon`: `:` /// - `arguments`: (``DifferentiabilityArgumentSyntax`` | ``DifferentiabilityArgumentsSyntax``) /// /// ### Contained in @@ -2479,6 +2615,10 @@ public struct DifferentiabilityWithRespectToArgumentSyntax: SyntaxProtocol, Synt } /// The "wrt" label. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `wrt`. public var wrtLabel: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -2498,6 +2638,10 @@ public struct DifferentiabilityWithRespectToArgumentSyntax: SyntaxProtocol, Synt } /// The colon separating "wrt" and the parameter list. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -2553,10 +2697,10 @@ public struct DifferentiabilityWithRespectToArgumentSyntax: SyntaxProtocol, Synt /// /// ### Children /// -/// - `kindSpecifier`: (`'_forward'` | `'reverse'` | `'_linear'`)? -/// - `kindSpecifierComma`: `','`? +/// - `kindSpecifier`: (`_forward` | `reverse` | `_linear`)? +/// - `kindSpecifierComma`: `,`? /// - `arguments`: ``DifferentiabilityWithRespectToArgumentSyntax``? -/// - `argumentsComma`: `','`? +/// - `argumentsComma`: `,`? /// - `genericWhereClause`: ``GenericWhereClauseSyntax``? /// /// ### Contained in @@ -2643,6 +2787,12 @@ public struct DifferentiableAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHash } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `_forward` + /// - `reverse` + /// - `_linear` public var kindSpecifier: TokenSyntax? { get { return Syntax(self).child(at: 1)?.cast(TokenSyntax.self) @@ -2662,6 +2812,10 @@ public struct DifferentiableAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHash } /// The comma following the differentiability kind, if it exists. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var kindSpecifierComma: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -2699,6 +2853,10 @@ public struct DifferentiableAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHash } /// The comma following the differentiability arguments clause, if it exists. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var argumentsComma: TokenSyntax? { get { return Syntax(self).child(at: 7)?.cast(TokenSyntax.self) @@ -2757,7 +2915,7 @@ public struct DifferentiableAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHash /// ### Children /// -/// - `wildcard`: `'_'` +/// - `wildcard`: `_` public struct DiscardAssignmentExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -2804,6 +2962,9 @@ public struct DiscardAssignmentExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _ } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `_`. public var wildcard: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -2831,7 +2992,7 @@ public struct DiscardAssignmentExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _ /// ### Children /// -/// - `discardKeyword`: `'discard'` +/// - `discardKeyword`: `discard` /// - `expression`: ``ExprSyntax`` public struct DiscardStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -2893,6 +3054,9 @@ public struct DiscardStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSy } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `discard`. public var discardKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -2944,7 +3108,7 @@ public struct DiscardStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSy /// ### Children /// -/// - `doKeyword`: `'do'` +/// - `doKeyword`: `do` /// - `body`: ``CodeBlockSyntax`` /// - `catchClauses`: ``CatchClauseListSyntax`` public struct DoStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntaxNodeProtocol { @@ -3013,6 +3177,9 @@ public struct DoStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntaxN } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `do`. public var doKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3111,10 +3278,10 @@ public struct DoStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntaxN /// ### Children /// -/// - `label`: (`'visibility'` | `'metadata'`) -/// - `colon`: `':'` -/// - `value`: ((`` | `'private'` | `'fileprivate'` | `'internal'` | `'public'` | `'open'`) | ``StringLiteralExprSyntax``) -/// - `trailingComma`: `','`? +/// - `label`: (`visibility` | `metadata`) +/// - `colon`: `:` +/// - `value`: ((`` | `private` | `fileprivate` | `internal` | `public` | `open`) | ``StringLiteralExprSyntax``) +/// - `trailingComma`: `,`? /// /// ### Contained in /// @@ -3230,6 +3397,11 @@ public struct DocumentationAttributeArgumentSyntax: SyntaxProtocol, SyntaxHashab } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `visibility` + /// - `metadata` public var label: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3248,6 +3420,9 @@ public struct DocumentationAttributeArgumentSyntax: SyntaxProtocol, SyntaxHashab } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -3285,6 +3460,10 @@ public struct DocumentationAttributeArgumentSyntax: SyntaxProtocol, SyntaxHashab } /// A trailing comma if this argument is followed by another one + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var trailingComma: TokenSyntax? { get { return Syntax(self).child(at: 7)?.cast(TokenSyntax.self) @@ -3324,8 +3503,8 @@ public struct DocumentationAttributeArgumentSyntax: SyntaxProtocol, SyntaxHashab /// /// ### Children /// -/// - `forLabel`: `'for'` -/// - `colon`: `':'` +/// - `forLabel`: `for` +/// - `colon`: `:` /// - `declName`: ``DeclReferenceExprSyntax`` /// /// ### Contained in @@ -3397,6 +3576,9 @@ public struct DynamicReplacementAttributeArgumentsSyntax: SyntaxProtocol, Syntax } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `for`. public var forLabel: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3415,6 +3597,9 @@ public struct DynamicReplacementAttributeArgumentsSyntax: SyntaxProtocol, Syntax } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesEF.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesEF.swift index 6715763970b..0bd1ee15e0a 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesEF.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesEF.swift @@ -183,6 +183,10 @@ public struct EditorPlaceholderDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _ } /// The actual editor placeholder that starts with `<#` and ends with `#>`. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var placeholder: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -265,6 +269,9 @@ public struct EditorPlaceholderExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _ } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var placeholder: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -296,7 +303,7 @@ public struct EditorPlaceholderExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _ /// /// - `attributes`: ``AttributeListSyntax`` /// - `modifiers`: ``DeclModifierListSyntax`` -/// - `caseKeyword`: `'case'` +/// - `caseKeyword`: `case` /// - `elements`: ``EnumCaseElementListSyntax`` public struct EnumCaseDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -467,6 +474,10 @@ public struct EnumCaseDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS } /// The `case` keyword for this case. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `case`. public var caseKeyword: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -555,7 +566,7 @@ public struct EnumCaseDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS /// - `name`: `` /// - `parameterClause`: ``EnumCaseParameterClauseSyntax``? /// - `rawValue`: ``InitializerClauseSyntax``? -/// - `trailingComma`: `','`? +/// - `trailingComma`: `,`? /// /// ### Contained in /// @@ -637,6 +648,10 @@ public struct EnumCaseElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax } /// The name of this case. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var name: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -694,6 +709,10 @@ public struct EnumCaseElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax } /// The trailing comma of this element, if the case has multiple elements. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var trailingComma: TokenSyntax? { get { return Syntax(self).child(at: 7)?.cast(TokenSyntax.self) @@ -731,9 +750,9 @@ public struct EnumCaseElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax /// ### Children /// -/// - `leftParen`: `'('` +/// - `leftParen`: `(` /// - `parameters`: ``EnumCaseParameterListSyntax`` -/// - `rightParen`: `')'` +/// - `rightParen`: `)` /// /// ### Contained in /// @@ -808,6 +827,10 @@ public struct EnumCaseParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Le } /// The '(' to open the parameter clause. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `(`. public var leftParen: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -873,6 +896,10 @@ public struct EnumCaseParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Le } /// The ')' to close the parameter clause. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `)`. public var rightParen: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -909,12 +936,12 @@ public struct EnumCaseParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Le /// ### Children /// /// - `modifiers`: ``DeclModifierListSyntax`` -/// - `firstName`: (`` | `'_'`)? -/// - `secondName`: (`` | `'_'`)? -/// - `colon`: `':'`? +/// - `firstName`: (`` | `_`)? +/// - `secondName`: (`` | `_`)? +/// - `colon`: `:`? /// - `type`: ``TypeSyntax`` /// - `defaultValue`: ``InitializerClauseSyntax``? -/// - `trailingComma`: `','`? +/// - `trailingComma`: `,`? /// /// ### Contained in /// @@ -1058,6 +1085,11 @@ public struct EnumCaseParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `` + /// - `_` public var firstName: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -1076,6 +1108,11 @@ public struct EnumCaseParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `` + /// - `_` public var secondName: TokenSyntax? { get { return Syntax(self).child(at: 5)?.cast(TokenSyntax.self) @@ -1095,6 +1132,10 @@ public struct EnumCaseParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } /// If the parameter has a label, the colon separating the label from the type. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax? { get { return Syntax(self).child(at: 7)?.cast(TokenSyntax.self) @@ -1152,6 +1193,10 @@ public struct EnumCaseParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } /// If the parameter is followed by another parameter, the comma separating them. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var trailingComma: TokenSyntax? { get { return Syntax(self).child(at: 13)?.cast(TokenSyntax.self) @@ -1199,7 +1244,7 @@ public struct EnumCaseParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt /// /// - `attributes`: ``AttributeListSyntax`` /// - `modifiers`: ``DeclModifierListSyntax`` -/// - `enumKeyword`: `'enum'` +/// - `enumKeyword`: `enum` /// - `name`: `` /// - `genericParameterClause`: ``GenericParameterClauseSyntax``? /// - `inheritanceClause`: ``InheritanceClauseSyntax``? @@ -1402,6 +1447,10 @@ public struct EnumDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynta } /// The `enum` keyword for this declaration. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `enum`. public var enumKeyword: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -1421,6 +1470,10 @@ public struct EnumDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynta } /// Declares the name of this enum. If the name matches a reserved keyword use backticks to escape it. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var name: TokenSyntax { get { return Syntax(self).child(at: 7)!.cast(TokenSyntax.self) @@ -1545,7 +1598,7 @@ public struct EnumDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynta /// ### Children /// /// - `language`: ``TokenSyntax`` -/// - `comma`: `','`? +/// - `comma`: `,`? /// - `cxxName`: ``StringLiteralExprSyntax``? /// /// ### Contained in @@ -1635,6 +1688,9 @@ public struct ExposeAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable, _L } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var comma: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -1762,11 +1818,11 @@ public struct ExpressionPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _L /// ### Children /// -/// - `backslash`: `'\'` +/// - `backslash`: `\` /// - `pounds`: ``? -/// - `leftParen`: `'('` +/// - `leftParen`: `(` /// - `expressions`: ``LabeledExprListSyntax`` -/// - `rightParen`: `')'` +/// - `rightParen`: `)` /// /// ### Contained in /// @@ -1849,6 +1905,9 @@ public struct ExpressionSegmentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `\`. public var backslash: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -1867,6 +1926,9 @@ public struct ExpressionSegmentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var pounds: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -1885,6 +1947,9 @@ public struct ExpressionSegmentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `(`. public var leftParen: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -1948,6 +2013,9 @@ public struct ExpressionSegmentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `)`. public var rightParen: TokenSyntax { get { return Syntax(self).child(at: 9)!.cast(TokenSyntax.self) @@ -2063,7 +2131,7 @@ public struct ExpressionStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStm /// /// - `attributes`: ``AttributeListSyntax`` /// - `modifiers`: ``DeclModifierListSyntax`` -/// - `extensionKeyword`: `'extension'` +/// - `extensionKeyword`: `extension` /// - `extendedType`: ``TypeSyntax`` /// - `inheritanceClause`: ``InheritanceClauseSyntax``? /// - `genericWhereClause`: ``GenericWhereClauseSyntax``? @@ -2249,6 +2317,9 @@ public struct ExtensionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `extension`. public var extensionKeyword: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -2365,7 +2436,7 @@ public struct ExtensionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl /// ### Children /// -/// - `fallthroughKeyword`: `'fallthrough'` +/// - `fallthroughKeyword`: `fallthrough` public struct FallThroughStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -2412,6 +2483,9 @@ public struct FallThroughStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafSt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `fallthrough`. public var fallthroughKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -2486,6 +2560,9 @@ public struct FloatLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var literal: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -2513,13 +2590,13 @@ public struct FloatLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE /// ### Children /// -/// - `forKeyword`: `'for'` -/// - `tryKeyword`: `'try'`? -/// - `awaitKeyword`: `'await'`? -/// - `caseKeyword`: `'case'`? +/// - `forKeyword`: `for` +/// - `tryKeyword`: `try`? +/// - `awaitKeyword`: `await`? +/// - `caseKeyword`: `case`? /// - `pattern`: ``PatternSyntax`` /// - `typeAnnotation`: ``TypeAnnotationSyntax``? -/// - `inKeyword`: `'in'` +/// - `inKeyword`: `in` /// - `sequence`: ``ExprSyntax`` /// - `whereClause`: ``WhereClauseSyntax``? /// - `body`: ``CodeBlockSyntax`` @@ -2631,6 +2708,9 @@ public struct ForStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntax } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `for`. public var forKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -2649,6 +2729,9 @@ public struct ForStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntax } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `try`. public var tryKeyword: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -2667,6 +2750,9 @@ public struct ForStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntax } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `await`. public var awaitKeyword: TokenSyntax? { get { return Syntax(self).child(at: 5)?.cast(TokenSyntax.self) @@ -2685,6 +2771,9 @@ public struct ForStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntax } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `case`. public var caseKeyword: TokenSyntax? { get { return Syntax(self).child(at: 7)?.cast(TokenSyntax.self) @@ -2739,6 +2828,9 @@ public struct ForStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntax } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `in`. public var inKeyword: TokenSyntax { get { return Syntax(self).child(at: 13)!.cast(TokenSyntax.self) @@ -2843,7 +2935,7 @@ public struct ForStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntax /// ### Children /// /// - `expression`: ``ExprSyntax`` -/// - `exclamationMark`: `'!'` +/// - `exclamationMark`: `!` public struct ForceUnwrapExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -2922,6 +3014,9 @@ public struct ForceUnwrapExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafEx } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `!`. public var exclamationMark: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -2956,9 +3051,9 @@ public struct ForceUnwrapExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafEx /// ### Children /// /// - `calledExpression`: ``ExprSyntax`` -/// - `leftParen`: `'('`? +/// - `leftParen`: `(`? /// - `arguments`: ``LabeledExprListSyntax`` -/// - `rightParen`: `')'`? +/// - `rightParen`: `)`? /// - `trailingClosure`: ``ClosureExprSyntax``? /// - `additionalTrailingClosures`: ``MultipleTrailingClosureElementListSyntax`` public struct FunctionCallExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxNodeProtocol { @@ -3063,6 +3158,9 @@ public struct FunctionCallExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `(`. public var leftParen: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -3126,6 +3224,9 @@ public struct FunctionCallExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `)`. public var rightParen: TokenSyntax? { get { return Syntax(self).child(at: 7)?.cast(TokenSyntax.self) @@ -3232,7 +3333,7 @@ public struct FunctionCallExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE /// /// - `attributes`: ``AttributeListSyntax`` /// - `modifiers`: ``DeclModifierListSyntax`` -/// - `funcKeyword`: `'func'` +/// - `funcKeyword`: `func` /// - `name`: (`` | `` | `` | ``) /// - `genericParameterClause`: ``GenericParameterClauseSyntax``? /// - `signature`: ``FunctionSignatureSyntax`` @@ -3426,6 +3527,9 @@ public struct FunctionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `func`. public var funcKeyword: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -3444,6 +3548,13 @@ public struct FunctionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `` + /// - `` + /// - `` + /// - `` public var name: TokenSyntax { get { return Syntax(self).child(at: 7)!.cast(TokenSyntax.self) @@ -3563,8 +3674,8 @@ public struct FunctionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS /// ### Children /// -/// - `asyncSpecifier`: (`'async'` | `'reasync'`)? -/// - `throwsSpecifier`: (`'throws'` | `'rethrows'`)? +/// - `asyncSpecifier`: (`async` | `reasync`)? +/// - `throwsSpecifier`: (`throws` | `rethrows`)? /// /// ### Contained in /// @@ -3629,6 +3740,11 @@ public struct FunctionEffectSpecifiersSyntax: SyntaxProtocol, SyntaxHashable, _L } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `async` + /// - `reasync` public var asyncSpecifier: TokenSyntax? { get { return Syntax(self).child(at: 1)?.cast(TokenSyntax.self) @@ -3647,6 +3763,11 @@ public struct FunctionEffectSpecifiersSyntax: SyntaxProtocol, SyntaxHashable, _L } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `throws` + /// - `rethrows` public var throwsSpecifier: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -3680,9 +3801,9 @@ public struct FunctionEffectSpecifiersSyntax: SyntaxProtocol, SyntaxHashable, _L /// ### Children /// -/// - `leftParen`: `'('` +/// - `leftParen`: `(` /// - `parameters`: ``FunctionParameterListSyntax`` -/// - `rightParen`: `')'` +/// - `rightParen`: `)` /// /// ### Contained in /// @@ -3754,6 +3875,9 @@ public struct FunctionParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Le } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `(`. public var leftParen: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3817,6 +3941,9 @@ public struct FunctionParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Le } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `)`. public var rightParen: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -3854,13 +3981,13 @@ public struct FunctionParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Le /// /// - `attributes`: ``AttributeListSyntax`` /// - `modifiers`: ``DeclModifierListSyntax`` -/// - `firstName`: (`` | `'_'`) -/// - `secondName`: (`` | `'_'`)? -/// - `colon`: `':'` +/// - `firstName`: (`` | `_`) +/// - `secondName`: (`` | `_`)? +/// - `colon`: `:` /// - `type`: ``TypeSyntax`` -/// - `ellipsis`: `'...'`? +/// - `ellipsis`: `...`? /// - `defaultValue`: ``InitializerClauseSyntax``? -/// - `trailingComma`: `','`? +/// - `trailingComma`: `,`? /// /// ### Contained in /// @@ -4057,6 +4184,11 @@ public struct FunctionParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `` + /// - `_` public var firstName: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -4075,6 +4207,11 @@ public struct FunctionParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `` + /// - `_` public var secondName: TokenSyntax? { get { return Syntax(self).child(at: 7)?.cast(TokenSyntax.self) @@ -4093,6 +4230,9 @@ public struct FunctionParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax { get { return Syntax(self).child(at: 9)!.cast(TokenSyntax.self) @@ -4129,6 +4269,9 @@ public struct FunctionParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `...`. public var ellipsis: TokenSyntax? { get { return Syntax(self).child(at: 13)?.cast(TokenSyntax.self) @@ -4165,6 +4308,9 @@ public struct FunctionParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var trailingComma: TokenSyntax? { get { return Syntax(self).child(at: 17)?.cast(TokenSyntax.self) @@ -4358,9 +4504,9 @@ public struct FunctionSignatureSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt /// ### Children /// -/// - `leftParen`: `'('` +/// - `leftParen`: `(` /// - `parameters`: ``TupleTypeElementListSyntax`` -/// - `rightParen`: `')'` +/// - `rightParen`: `)` /// - `effectSpecifiers`: ``TypeEffectSpecifiersSyntax``? /// - `returnClause`: ``ReturnClauseSyntax`` public struct FunctionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSyntaxNodeProtocol { @@ -4441,6 +4587,9 @@ public struct FunctionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeS } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `(`. public var leftParen: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -4504,6 +4653,9 @@ public struct FunctionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeS } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `)`. public var rightParen: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesGHI.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesGHI.swift index 30d3572a9fb..b55b65c91ce 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesGHI.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesGHI.swift @@ -16,9 +16,9 @@ /// ### Children /// -/// - `leftAngle`: `'<'` +/// - `leftAngle`: `<` /// - `arguments`: ``GenericArgumentListSyntax`` -/// - `rightAngle`: `'>'` +/// - `rightAngle`: `>` /// /// ### Contained in /// @@ -94,6 +94,9 @@ public struct GenericArgumentClauseSyntax: SyntaxProtocol, SyntaxHashable, _Leaf } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `<`. public var leftAngle: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -157,6 +160,9 @@ public struct GenericArgumentClauseSyntax: SyntaxProtocol, SyntaxHashable, _Leaf } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `>`. public var rightAngle: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -193,7 +199,7 @@ public struct GenericArgumentClauseSyntax: SyntaxProtocol, SyntaxHashable, _Leaf /// ### Children /// /// - `argument`: ``TypeSyntax`` -/// - `trailingComma`: `','`? +/// - `trailingComma`: `,`? /// /// ### Contained in /// @@ -276,6 +282,9 @@ public struct GenericArgumentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var trailingComma: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -311,10 +320,10 @@ public struct GenericArgumentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax /// /// ### Children /// -/// - `leftAngle`: `'<'` +/// - `leftAngle`: `<` /// - `parameters`: ``GenericParameterListSyntax`` /// - `genericWhereClause`: ``GenericWhereClauseSyntax``? -/// - `rightAngle`: `'>'` +/// - `rightAngle`: `>` /// /// ### Contained in /// @@ -405,6 +414,10 @@ public struct GenericParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Lea } /// The opening angle bracket (`<`) of the generic parameter clause. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `<`. public var leftAngle: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -489,6 +502,10 @@ public struct GenericParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Lea } /// The closing angle bracket (`>`) of the generic parameter clause. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `>`. public var rightAngle: TokenSyntax { get { return Syntax(self).child(at: 7)!.cast(TokenSyntax.self) @@ -527,11 +544,11 @@ public struct GenericParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Lea /// ### Children /// /// - `attributes`: ``AttributeListSyntax`` -/// - `eachKeyword`: `'each'`? +/// - `eachKeyword`: `each`? /// - `name`: `` -/// - `colon`: `':'`? +/// - `colon`: `:`? /// - `inheritedType`: ``TypeSyntax``? -/// - `trailingComma`: `','`? +/// - `trailingComma`: `,`? /// /// ### Contained in /// @@ -665,6 +682,9 @@ public struct GenericParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `each`. public var eachKeyword: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -683,6 +703,9 @@ public struct GenericParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var name: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -701,6 +724,9 @@ public struct GenericParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax? { get { return Syntax(self).child(at: 7)?.cast(TokenSyntax.self) @@ -737,6 +763,9 @@ public struct GenericParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var trailingComma: TokenSyntax? { get { return Syntax(self).child(at: 11)?.cast(TokenSyntax.self) @@ -779,7 +808,7 @@ public struct GenericParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta /// ### Children /// /// - `requirement`: (``SameTypeRequirementSyntax`` | ``ConformanceRequirementSyntax`` | ``LayoutRequirementSyntax``) -/// - `trailingComma`: `','`? +/// - `trailingComma`: `,`? /// /// ### Contained in /// @@ -911,6 +940,9 @@ public struct GenericRequirementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var trailingComma: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -1059,7 +1091,7 @@ public struct GenericSpecializationExprSyntax: ExprSyntaxProtocol, SyntaxHashabl /// /// ### Children /// -/// - `whereKeyword`: `'where'` +/// - `whereKeyword`: `where` /// - `requirements`: ``GenericRequirementListSyntax`` /// /// ### Contained in @@ -1142,6 +1174,10 @@ public struct GenericWhereClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn } /// The `where` keyword in the clause. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `where`. public var whereKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -1221,9 +1257,9 @@ public struct GenericWhereClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn /// ### Children /// -/// - `guardKeyword`: `'guard'` +/// - `guardKeyword`: `guard` /// - `conditions`: ``ConditionElementListSyntax`` -/// - `elseKeyword`: `'else'` +/// - `elseKeyword`: `else` /// - `body`: ``CodeBlockSyntax`` public struct GuardStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -1297,6 +1333,9 @@ public struct GuardStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `guard`. public var guardKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -1360,6 +1399,9 @@ public struct GuardStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `else`. public var elseKeyword: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -1415,7 +1457,7 @@ public struct GuardStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt /// ### Children /// -/// - `identifier`: (`` | `'self'` | `'init'`) +/// - `identifier`: (`` | `self` | `init`) public struct IdentifierPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _LeafPatternSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -1462,6 +1504,12 @@ public struct IdentifierPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _L } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `` + /// - `self` + /// - `init` public var identifier: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -1489,7 +1537,7 @@ public struct IdentifierPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _L /// ### Children /// -/// - `name`: (`` | `'Self'` | `'Any'` | `'_'`) +/// - `name`: (`` | `Self` | `Any` | `_`) /// - `genericArgumentClause`: ``GenericArgumentClauseSyntax``? public struct IdentifierTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -1551,6 +1599,13 @@ public struct IdentifierTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `` + /// - `Self` + /// - `Any` + /// - `_` public var name: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -1602,7 +1657,7 @@ public struct IdentifierTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp /// ### Children /// -/// - `poundKeyword`: (`'#if'` | `'#elseif'` | `'#else'`) +/// - `poundKeyword`: (`#if` | `#elseif` | `#else`) /// - `condition`: ``ExprSyntax``? /// - `elements`: (``CodeBlockItemListSyntax`` | ``SwitchCaseListSyntax`` | ``MemberBlockItemListSyntax`` | ``ExprSyntax`` | ``AttributeListSyntax``)? /// @@ -1752,6 +1807,12 @@ public struct IfConfigClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `#if` + /// - `#elseif` + /// - `#else` public var poundKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -1824,7 +1885,7 @@ public struct IfConfigClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN /// ### Children /// /// - `clauses`: ``IfConfigClauseListSyntax`` -/// - `poundEndif`: `'#endif'` +/// - `poundEndif`: `#endif` /// /// ### Contained in /// @@ -1936,6 +1997,9 @@ public struct IfConfigDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `#endif`. public var poundEndif: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -1969,10 +2033,10 @@ public struct IfConfigDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS /// ### Children /// -/// - `ifKeyword`: `'if'` +/// - `ifKeyword`: `if` /// - `conditions`: ``ConditionElementListSyntax`` /// - `body`: ``CodeBlockSyntax`` -/// - `elseKeyword`: `'else'`? +/// - `elseKeyword`: `else`? /// - `elseBody`: (``IfExprSyntax`` | ``CodeBlockSyntax``)? /// /// ### Contained in @@ -2094,6 +2158,9 @@ public struct IfExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxN } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `if`. public var ifKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -2175,6 +2242,9 @@ public struct IfExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxN } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `else`. public var elseKeyword: TokenSyntax? { get { return Syntax(self).child(at: 7)?.cast(TokenSyntax.self) @@ -2235,7 +2305,7 @@ public struct IfExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxN /// ### Children /// /// - `type`: ``TypeSyntax`` -/// - `comma`: `','` +/// - `comma`: `,` /// - `declName`: ``DeclReferenceExprSyntax`` /// /// ### Contained in @@ -2330,6 +2400,10 @@ public struct ImplementsAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable } /// The comma separating the type and method name + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var comma: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -2385,7 +2459,7 @@ public struct ImplementsAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable /// ### Children /// /// - `wrappedType`: ``TypeSyntax`` -/// - `exclamationMark`: `'!'` +/// - `exclamationMark`: `!` public struct ImplicitlyUnwrappedOptionalTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -2464,6 +2538,9 @@ public struct ImplicitlyUnwrappedOptionalTypeSyntax: TypeSyntaxProtocol, SyntaxH } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `!`. public var exclamationMark: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -2507,8 +2584,8 @@ public struct ImplicitlyUnwrappedOptionalTypeSyntax: TypeSyntaxProtocol, SyntaxH /// /// - `attributes`: ``AttributeListSyntax`` /// - `modifiers`: ``DeclModifierListSyntax`` -/// - `importKeyword`: `'import'` -/// - `importKindSpecifier`: (`'typealias'` | `'struct'` | `'class'` | `'enum'` | `'protocol'` | `'var'` | `'let'` | `'func'` | `'inout'`)? +/// - `importKeyword`: `import` +/// - `importKindSpecifier`: (`typealias` | `struct` | `class` | `enum` | `protocol` | `var` | `let` | `func` | `inout`)? /// - `path`: ``ImportPathComponentListSyntax`` public struct ImportDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -2686,6 +2763,10 @@ public struct ImportDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyn } /// The `import` keyword for this declaration. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `import`. public var importKeyword: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -2707,6 +2788,19 @@ public struct ImportDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyn /// The kind of declaration being imported. /// /// A struct can be imported from a specific module. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `typealias` + /// - `struct` + /// - `class` + /// - `enum` + /// - `protocol` + /// - `var` + /// - `let` + /// - `func` + /// - `inout` public var importKindSpecifier: TokenSyntax? { get { return Syntax(self).child(at: 7)?.cast(TokenSyntax.self) @@ -2793,7 +2887,7 @@ public struct ImportDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyn /// ### Children /// /// - `name`: (`` | `` | `` | ``) -/// - `trailingPeriod`: `'.'`? +/// - `trailingPeriod`: `.`? /// /// ### Contained in /// @@ -2858,6 +2952,13 @@ public struct ImportPathComponentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `` + /// - `` + /// - `` + /// - `` public var name: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -2876,6 +2977,9 @@ public struct ImportPathComponentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `.`. public var trailingPeriod: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -2909,7 +3013,7 @@ public struct ImportPathComponentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy /// ### Children /// -/// - `ampersand`: `'&'` +/// - `ampersand`: `&` /// - `expression`: ``ExprSyntax`` public struct InOutExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -2971,6 +3075,9 @@ public struct InOutExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `&`. public var ampersand: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3162,7 +3269,7 @@ public struct InfixOperatorExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf /// ### Children /// -/// - `colon`: `':'` +/// - `colon`: `:` /// - `inheritedTypes`: ``InheritedTypeListSyntax`` /// /// ### Contained in @@ -3234,6 +3341,9 @@ public struct InheritanceClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3313,7 +3423,7 @@ public struct InheritanceClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt /// ### Children /// /// - `type`: ``TypeSyntax`` -/// - `trailingComma`: `','`? +/// - `trailingComma`: `,`? /// /// ### Contained in /// @@ -3396,6 +3506,9 @@ public struct InheritedTypeSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNo } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var trailingComma: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -3429,7 +3542,7 @@ public struct InheritedTypeSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNo /// ### Children /// -/// - `equal`: `'='` +/// - `equal`: `=` /// - `value`: ``ExprSyntax`` /// /// ### Contained in @@ -3501,6 +3614,9 @@ public struct InitializerClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `=`. public var equal: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3565,8 +3681,8 @@ public struct InitializerClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt /// /// - `attributes`: ``AttributeListSyntax`` /// - `modifiers`: ``DeclModifierListSyntax`` -/// - `initKeyword`: `'init'` -/// - `optionalMark`: (`'?'` | `'!'`)? +/// - `initKeyword`: `init` +/// - `optionalMark`: (`?` | `!`)? /// - `genericParameterClause`: ``GenericParameterClauseSyntax``? /// - `signature`: ``FunctionSignatureSyntax`` /// - `genericWhereClause`: ``GenericWhereClauseSyntax``? @@ -3768,6 +3884,10 @@ public struct InitializerDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDe } /// The init keyword + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `init`. public var initKeyword: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -3787,6 +3907,12 @@ public struct InitializerDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDe } /// If the initializer is failable, a question mark to indicate that. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `?` + /// - `!` public var optionalMark: TokenSyntax? { get { return Syntax(self).child(at: 7)?.cast(TokenSyntax.self) @@ -3955,6 +4081,9 @@ public struct IntegerLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var literal: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3993,7 +4122,7 @@ public struct IntegerLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea /// ### Children /// /// - `expression`: ``ExprSyntax`` -/// - `isKeyword`: `'is'` +/// - `isKeyword`: `is` /// - `type`: ``TypeSyntax`` public struct IsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -4084,6 +4213,10 @@ public struct IsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxN } /// The `is` keyword for this expression. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `is`. public var isKeyword: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -4138,7 +4271,7 @@ public struct IsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxN /// ### Children /// -/// - `isKeyword`: `'is'` +/// - `isKeyword`: `is` /// - `type`: ``TypeSyntax`` public struct IsTypePatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _LeafPatternSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -4200,6 +4333,9 @@ public struct IsTypePatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _LeafP } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `is`. public var isKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesJKLMN.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesJKLMN.swift index a5564a5849e..de655e5285b 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesJKLMN.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesJKLMN.swift @@ -16,7 +16,7 @@ /// ### Children /// -/// - `period`: `'.'`? +/// - `period`: `.`? /// - `component`: (``KeyPathPropertyComponentSyntax`` | ``KeyPathSubscriptComponentSyntax`` | ``KeyPathOptionalComponentSyntax``) /// /// ### Contained in @@ -131,6 +131,9 @@ public struct KeyPathComponentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `.`. public var period: TokenSyntax? { get { return Syntax(self).child(at: 1)?.cast(TokenSyntax.self) @@ -182,7 +185,7 @@ public struct KeyPathComponentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta /// ### Children /// -/// - `backslash`: `'\'` +/// - `backslash`: `\` /// - `root`: ``TypeSyntax``? /// - `components`: ``KeyPathComponentListSyntax`` public struct KeyPathExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxNodeProtocol { @@ -251,6 +254,9 @@ public struct KeyPathExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `\`. public var backslash: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -349,7 +355,7 @@ public struct KeyPathExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy /// ### Children /// -/// - `questionOrExclamationMark`: (`'?'` | `'!'`) +/// - `questionOrExclamationMark`: (`?` | `!`) /// /// ### Contained in /// @@ -400,6 +406,11 @@ public struct KeyPathOptionalComponentSyntax: SyntaxProtocol, SyntaxHashable, _L } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `?` + /// - `!` public var questionOrExclamationMark: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -544,9 +555,9 @@ public struct KeyPathPropertyComponentSyntax: SyntaxProtocol, SyntaxHashable, _L /// ### Children /// -/// - `leftSquare`: `'['` +/// - `leftSquare`: `[` /// - `arguments`: ``LabeledExprListSyntax`` -/// - `rightSquare`: `']'` +/// - `rightSquare`: `]` /// /// ### Contained in /// @@ -617,6 +628,9 @@ public struct KeyPathSubscriptComponentSyntax: SyntaxProtocol, SyntaxHashable, _ } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `[`. public var leftSquare: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -680,6 +694,9 @@ public struct KeyPathSubscriptComponentSyntax: SyntaxProtocol, SyntaxHashable, _ } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `]`. public var rightSquare: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -715,10 +732,10 @@ public struct KeyPathSubscriptComponentSyntax: SyntaxProtocol, SyntaxHashable, _ /// ### Children /// -/// - `label`: (`` | `'_'`)? -/// - `colon`: `':'`? +/// - `label`: (`` | `_`)? +/// - `colon`: `:`? /// - `expression`: ``ExprSyntax`` -/// - `trailingComma`: `','`? +/// - `trailingComma`: `,`? /// /// ### Contained in /// @@ -795,6 +812,11 @@ public struct LabeledExprSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `` + /// - `_` public var label: TokenSyntax? { get { return Syntax(self).child(at: 1)?.cast(TokenSyntax.self) @@ -813,6 +835,9 @@ public struct LabeledExprSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -849,6 +874,9 @@ public struct LabeledExprSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var trailingComma: TokenSyntax? { get { return Syntax(self).child(at: 7)?.cast(TokenSyntax.self) @@ -888,10 +916,10 @@ public struct LabeledExprSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode /// /// ### Children /// -/// - `label`: (`'target'` | `'availability'` | `'exported'` | `'kind'` | `'spi'` | `'spiModule'` | `'available'`) -/// - `colon`: `':'` +/// - `label`: (`target` | `availability` | `exported` | `kind` | `spi` | `spiModule` | `available`) +/// - `colon`: `:` /// - `value`: ``TokenSyntax`` -/// - `trailingComma`: `','`? +/// - `trailingComma`: `,`? /// /// ### Contained in /// @@ -973,6 +1001,17 @@ public struct LabeledSpecializeArgumentSyntax: SyntaxProtocol, SyntaxHashable, _ } /// The label of the argument + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `target` + /// - `availability` + /// - `exported` + /// - `kind` + /// - `spi` + /// - `spiModule` + /// - `available` public var label: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -992,6 +1031,10 @@ public struct LabeledSpecializeArgumentSyntax: SyntaxProtocol, SyntaxHashable, _ } /// The colon separating the label and the value + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -1030,6 +1073,10 @@ public struct LabeledSpecializeArgumentSyntax: SyntaxProtocol, SyntaxHashable, _ } /// A trailing comma if this argument is followed by another one + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var trailingComma: TokenSyntax? { get { return Syntax(self).child(at: 7)?.cast(TokenSyntax.self) @@ -1068,7 +1115,7 @@ public struct LabeledSpecializeArgumentSyntax: SyntaxProtocol, SyntaxHashable, _ /// ### Children /// /// - `label`: `` -/// - `colon`: `':'` +/// - `colon`: `:` /// - `statement`: ``StmtSyntax`` public struct LabeledStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -1136,6 +1183,9 @@ public struct LabeledStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSy } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var label: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -1154,6 +1204,9 @@ public struct LabeledStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSy } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -1208,13 +1261,13 @@ public struct LabeledStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSy /// ### Children /// /// - `type`: ``TypeSyntax`` -/// - `colon`: `':'` -/// - `layoutSpecifier`: (`'_Trivial'` | `'_TrivialAtMost'` | `'_UnknownLayout'` | `'_RefCountedObject'` | `'_NativeRefCountedObject'` | `'_Class'` | `'_NativeClass'`) -/// - `leftParen`: `'('`? +/// - `colon`: `:` +/// - `layoutSpecifier`: (`_Trivial` | `_TrivialAtMost` | `_UnknownLayout` | `_RefCountedObject` | `_NativeRefCountedObject` | `_Class` | `_NativeClass`) +/// - `leftParen`: `(`? /// - `size`: ``? -/// - `comma`: `','`? +/// - `comma`: `,`? /// - `alignment`: ``? -/// - `rightParen`: `')'`? +/// - `rightParen`: `)`? /// /// ### Contained in /// @@ -1333,6 +1386,9 @@ public struct LayoutRequirementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -1351,6 +1407,16 @@ public struct LayoutRequirementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `_Trivial` + /// - `_TrivialAtMost` + /// - `_UnknownLayout` + /// - `_RefCountedObject` + /// - `_NativeRefCountedObject` + /// - `_Class` + /// - `_NativeClass` public var layoutSpecifier: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -1369,6 +1435,9 @@ public struct LayoutRequirementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `(`. public var leftParen: TokenSyntax? { get { return Syntax(self).child(at: 7)?.cast(TokenSyntax.self) @@ -1387,6 +1456,9 @@ public struct LayoutRequirementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var size: TokenSyntax? { get { return Syntax(self).child(at: 9)?.cast(TokenSyntax.self) @@ -1405,6 +1477,9 @@ public struct LayoutRequirementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var comma: TokenSyntax? { get { return Syntax(self).child(at: 11)?.cast(TokenSyntax.self) @@ -1423,6 +1498,9 @@ public struct LayoutRequirementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var alignment: TokenSyntax? { get { return Syntax(self).child(at: 13)?.cast(TokenSyntax.self) @@ -1441,6 +1519,9 @@ public struct LayoutRequirementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `)`. public var rightParen: TokenSyntax? { get { return Syntax(self).child(at: 15)?.cast(TokenSyntax.self) @@ -1488,7 +1569,7 @@ public struct LayoutRequirementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt /// /// - `attributes`: ``AttributeListSyntax`` /// - `modifiers`: ``DeclModifierListSyntax`` -/// - `macroKeyword`: `'macro'` +/// - `macroKeyword`: `macro` /// - `name`: `` /// - `genericParameterClause`: ``GenericParameterClauseSyntax``? /// - `signature`: ``FunctionSignatureSyntax`` @@ -1682,6 +1763,9 @@ public struct MacroDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `macro`. public var macroKeyword: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -1700,6 +1784,9 @@ public struct MacroDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var name: TokenSyntax { get { return Syntax(self).child(at: 7)!.cast(TokenSyntax.self) @@ -1821,12 +1908,12 @@ public struct MacroDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt /// /// - `attributes`: ``AttributeListSyntax`` /// - `modifiers`: ``DeclModifierListSyntax`` -/// - `pound`: `'#'` +/// - `pound`: `#` /// - `macroName`: `` /// - `genericArgumentClause`: ``GenericArgumentClauseSyntax``? -/// - `leftParen`: `'('`? +/// - `leftParen`: `(`? /// - `arguments`: ``LabeledExprListSyntax`` -/// - `rightParen`: `')'`? +/// - `rightParen`: `)`? /// - `trailingClosure`: ``ClosureExprSyntax``? /// - `additionalTrailingClosures`: ``MultipleTrailingClosureElementListSyntax`` public struct MacroExpansionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyntaxNodeProtocol { @@ -2029,6 +2116,10 @@ public struct MacroExpansionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Lea } /// The `#` sign. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `#`. public var pound: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -2047,6 +2138,9 @@ public struct MacroExpansionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Lea } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var macroName: TokenSyntax { get { return Syntax(self).child(at: 7)!.cast(TokenSyntax.self) @@ -2083,6 +2177,9 @@ public struct MacroExpansionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Lea } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `(`. public var leftParen: TokenSyntax? { get { return Syntax(self).child(at: 11)?.cast(TokenSyntax.self) @@ -2146,6 +2243,9 @@ public struct MacroExpansionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Lea } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `)`. public var rightParen: TokenSyntax? { get { return Syntax(self).child(at: 15)?.cast(TokenSyntax.self) @@ -2258,12 +2358,12 @@ public struct MacroExpansionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Lea /// ### Children /// -/// - `pound`: `'#'` +/// - `pound`: `#` /// - `macroName`: `` /// - `genericArgumentClause`: ``GenericArgumentClauseSyntax``? -/// - `leftParen`: `'('`? +/// - `leftParen`: `(`? /// - `arguments`: ``LabeledExprListSyntax`` -/// - `rightParen`: `')'`? +/// - `rightParen`: `)`? /// - `trailingClosure`: ``ClosureExprSyntax``? /// - `additionalTrailingClosures`: ``MultipleTrailingClosureElementListSyntax`` public struct MacroExpansionExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxNodeProtocol { @@ -2364,6 +2464,10 @@ public struct MacroExpansionExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea } /// The `#` sign. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `#`. public var pound: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -2382,6 +2486,9 @@ public struct MacroExpansionExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var macroName: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -2418,6 +2525,9 @@ public struct MacroExpansionExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `(`. public var leftParen: TokenSyntax? { get { return Syntax(self).child(at: 7)?.cast(TokenSyntax.self) @@ -2481,6 +2591,9 @@ public struct MacroExpansionExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `)`. public var rightParen: TokenSyntax? { get { return Syntax(self).child(at: 11)?.cast(TokenSyntax.self) @@ -2589,7 +2702,7 @@ public struct MacroExpansionExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea /// ### Children /// -/// - `caseKeyword`: `'case'` +/// - `caseKeyword`: `case` /// - `pattern`: ``PatternSyntax`` /// - `typeAnnotation`: ``TypeAnnotationSyntax``? /// - `initializer`: ``InitializerClauseSyntax`` @@ -2669,6 +2782,9 @@ public struct MatchingPatternConditionSyntax: SyntaxProtocol, SyntaxHashable, _L } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `case`. public var caseKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -2763,7 +2879,7 @@ public struct MatchingPatternConditionSyntax: SyntaxProtocol, SyntaxHashable, _L /// ### Children /// /// - `base`: ``ExprSyntax``? -/// - `period`: `'.'` +/// - `period`: `.` /// - `declName`: ``DeclReferenceExprSyntax`` public struct MemberAccessExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -2852,6 +2968,9 @@ public struct MemberAccessExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `.`. public var period: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -2909,7 +3028,7 @@ public struct MemberAccessExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE /// ### Children /// /// - `decl`: ``DeclSyntax`` -/// - `semicolon`: `';'`? +/// - `semicolon`: `;`? /// /// ### Contained in /// @@ -2996,6 +3115,10 @@ public struct MemberBlockItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax } /// An optional trailing semicolon. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `;`. public var semicolon: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -3029,9 +3152,9 @@ public struct MemberBlockItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax /// ### Children /// -/// - `leftBrace`: `'{'` +/// - `leftBrace`: `{` /// - `members`: ``MemberBlockItemListSyntax`` -/// - `rightBrace`: `'}'` +/// - `rightBrace`: `}` /// /// ### Contained in /// @@ -3107,6 +3230,9 @@ public struct MemberBlockSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `{`. public var leftBrace: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3170,6 +3296,9 @@ public struct MemberBlockSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `}`. public var rightBrace: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -3206,8 +3335,8 @@ public struct MemberBlockSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode /// ### Children /// /// - `baseType`: ``TypeSyntax`` -/// - `period`: `'.'` -/// - `name`: (`` | `'self'`) +/// - `period`: `.` +/// - `name`: (`` | `self`) /// - `genericArgumentClause`: ``GenericArgumentClauseSyntax``? public struct MemberTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -3299,6 +3428,9 @@ public struct MemberTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSyn } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `.`. public var period: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -3317,6 +3449,11 @@ public struct MemberTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSyn } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `` + /// - `self` public var name: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -3373,8 +3510,8 @@ public struct MemberTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSyn /// ### Children /// /// - `baseType`: ``TypeSyntax`` -/// - `period`: `'.'` -/// - `metatypeSpecifier`: (`'Type'` | `'Protocol'`) +/// - `period`: `.` +/// - `metatypeSpecifier`: (`Type` | `Protocol`) public struct MetatypeTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -3459,6 +3596,9 @@ public struct MetatypeTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeS } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `.`. public var period: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -3477,6 +3617,11 @@ public struct MetatypeTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeS } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `Type` + /// - `Protocol` public var metatypeSpecifier: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -3681,6 +3826,10 @@ public struct MissingDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSy /// A placeholder, i.e. `<#decl#>`, that can be inserted into the source code to represent the missing declaration. /// /// This token should always have `presence = .missing`. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var placeholder: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -3769,6 +3918,10 @@ public struct MissingExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy /// A placeholder, i.e. `<#expression#>`, that can be inserted into the source code to represent the missing expression. /// /// This token should always have `presence = .missing`. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var placeholder: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3849,6 +4002,10 @@ public struct MissingPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _Leaf /// A placeholder, i.e. `<#pattern#>`, that can be inserted into the source code to represent the missing pattern. /// /// This token should always have `presence = .missing`. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var placeholder: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3929,6 +4086,10 @@ public struct MissingStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSy /// A placeholder, i.e. `<#statement#>`, that can be inserted into the source code to represent the missing pattern. /// /// This token should always have `presence = .missing`. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var placeholder: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -4009,6 +4170,10 @@ public struct MissingSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodeProt /// A placeholder, i.e. `<#syntax#>`, that can be inserted into the source code to represent the missing pattern. /// /// This token should always have `presence = .missing` + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var placeholder: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -4089,6 +4254,10 @@ public struct MissingTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSy /// A placeholder, i.e. `<#type#>`, that can be inserted into the source code to represent the missing type. /// /// This token should always have `presence = .missing`. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var placeholder: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -4116,8 +4285,8 @@ public struct MissingTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSy /// ### Children /// -/// - `label`: (`` | `'_'`) -/// - `colon`: `':'` +/// - `label`: (`` | `_`) +/// - `colon`: `:` /// - `closure`: ``ClosureExprSyntax`` /// /// ### Contained in @@ -4189,6 +4358,11 @@ public struct MultipleTrailingClosureElementSyntax: SyntaxProtocol, SyntaxHashab } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `` + /// - `_` public var label: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -4207,6 +4381,9 @@ public struct MultipleTrailingClosureElementSyntax: SyntaxProtocol, SyntaxHashab } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -4375,7 +4552,7 @@ public struct NamedOpaqueReturnTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _ /// ### Children /// -/// - `nilKeyword`: `'nil'` +/// - `nilKeyword`: `nil` public struct NilLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -4422,6 +4599,9 @@ public struct NilLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExp } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `nil`. public var nilKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesOP.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesOP.swift index 02ef36d33c8..b6c582f2e50 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesOP.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesOP.swift @@ -19,7 +19,7 @@ /// ### Children /// /// - `name`: ``TokenSyntax``? -/// - `colon`: `':'`? +/// - `colon`: `:`? /// /// ### Contained in /// @@ -102,6 +102,9 @@ public struct ObjCSelectorPieceSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -138,7 +141,7 @@ public struct ObjCSelectorPieceSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt /// ### Children /// /// - `mangledName`: ``StringLiteralExprSyntax`` -/// - `comma`: `','` +/// - `comma`: `,` /// - `ordinal`: `` /// /// ### Contained in @@ -231,6 +234,9 @@ public struct OpaqueReturnTypeOfAttributeArgumentsSyntax: SyntaxProtocol, Syntax } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var comma: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -250,6 +256,10 @@ public struct OpaqueReturnTypeOfAttributeArgumentsSyntax: SyntaxProtocol, Syntax } /// The ordinal corresponding to the 'some' keyword that introduced this opaque type. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var ordinal: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -287,8 +297,8 @@ public struct OpaqueReturnTypeOfAttributeArgumentsSyntax: SyntaxProtocol, Syntax /// /// ### Children /// -/// - `fixitySpecifier`: (`'prefix'` | `'postfix'` | `'infix'`) -/// - `operatorKeyword`: `'operator'` +/// - `fixitySpecifier`: (`prefix` | `postfix` | `infix`) +/// - `operatorKeyword`: `operator` /// - `name`: (`` | `` | ``) /// - `operatorPrecedenceAndTypes`: ``OperatorPrecedenceAndTypesSyntax``? public struct OperatorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyntaxNodeProtocol { @@ -366,6 +376,13 @@ public struct OperatorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS } /// The fixity applied to the 'operator' declaration. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `prefix` + /// - `postfix` + /// - `infix` public var fixitySpecifier: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -384,6 +401,9 @@ public struct OperatorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `operator`. public var operatorKeyword: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -402,6 +422,12 @@ public struct OperatorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `` + /// - `` + /// - `` public var name: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -460,7 +486,7 @@ public struct OperatorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS /// /// ### Children /// -/// - `colon`: `':'` +/// - `colon`: `:` /// - `precedenceGroup`: `` /// - `designatedTypes`: ``DesignatedTypeListSyntax`` /// @@ -535,6 +561,9 @@ public struct OperatorPrecedenceAndTypesSyntax: SyntaxProtocol, SyntaxHashable, } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -554,6 +583,10 @@ public struct OperatorPrecedenceAndTypesSyntax: SyntaxProtocol, SyntaxHashable, } /// The precedence group for this operator + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var precedenceGroup: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -635,7 +668,7 @@ public struct OperatorPrecedenceAndTypesSyntax: SyntaxProtocol, SyntaxHashable, /// ### Children /// -/// - `bindingSpecifier`: (`'let'` | `'var'` | `'inout'` | `'_mutating'` | `'_borrowing'` | `'_consuming'`) +/// - `bindingSpecifier`: (`let` | `var` | `inout` | `_mutating` | `_borrowing` | `_consuming`) /// - `pattern`: ``PatternSyntax`` /// - `typeAnnotation`: ``TypeAnnotationSyntax``? /// - `initializer`: ``InitializerClauseSyntax``? @@ -715,6 +748,15 @@ public struct OptionalBindingConditionSyntax: SyntaxProtocol, SyntaxHashable, _L } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `let` + /// - `var` + /// - `inout` + /// - `_mutating` + /// - `_borrowing` + /// - `_consuming` public var bindingSpecifier: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -807,7 +849,7 @@ public struct OptionalBindingConditionSyntax: SyntaxProtocol, SyntaxHashable, _L /// ### Children /// /// - `expression`: ``ExprSyntax`` -/// - `questionMark`: `'?'` +/// - `questionMark`: `?` public struct OptionalChainingExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -886,6 +928,9 @@ public struct OptionalChainingExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _L } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `?`. public var questionMark: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -920,7 +965,7 @@ public struct OptionalChainingExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _L /// ### Children /// /// - `wrappedType`: ``TypeSyntax`` -/// - `questionMark`: `'?'` +/// - `questionMark`: `?` public struct OptionalTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -999,6 +1044,9 @@ public struct OptionalTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeS } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `?`. public var questionMark: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -1034,10 +1082,10 @@ public struct OptionalTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeS /// /// ### Children /// -/// - `moduleLabel`: `'module'` -/// - `colon`: `':'` +/// - `moduleLabel`: `module` +/// - `colon`: `:` /// - `moduleName`: ``StringLiteralExprSyntax`` -/// - `comma`: `','` +/// - `comma`: `,` /// - `platforms`: ``PlatformVersionItemListSyntax`` /// /// ### Contained in @@ -1121,6 +1169,9 @@ public struct OriginallyDefinedInAttributeArgumentsSyntax: SyntaxProtocol, Synta } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `module`. public var moduleLabel: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -1139,6 +1190,9 @@ public struct OriginallyDefinedInAttributeArgumentsSyntax: SyntaxProtocol, Synta } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -1175,6 +1229,9 @@ public struct OriginallyDefinedInAttributeArgumentsSyntax: SyntaxProtocol, Synta } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var comma: TokenSyntax { get { return Syntax(self).child(at: 7)!.cast(TokenSyntax.self) @@ -1259,7 +1316,7 @@ public struct OriginallyDefinedInAttributeArgumentsSyntax: SyntaxProtocol, Synta /// ### Children /// -/// - `eachKeyword`: `'each'` +/// - `eachKeyword`: `each` /// - `pack`: ``ExprSyntax`` public struct PackElementExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -1321,6 +1378,9 @@ public struct PackElementExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafEx } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `each`. public var eachKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -1372,7 +1432,7 @@ public struct PackElementExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafEx /// ### Children /// -/// - `eachKeyword`: `'each'` +/// - `eachKeyword`: `each` /// - `pack`: ``TypeSyntax`` public struct PackElementTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -1434,6 +1494,9 @@ public struct PackElementTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTy } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `each`. public var eachKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -1485,7 +1548,7 @@ public struct PackElementTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTy /// ### Children /// -/// - `repeatKeyword`: `'repeat'` +/// - `repeatKeyword`: `repeat` /// - `repetitionPattern`: ``ExprSyntax`` public struct PackExpansionExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -1547,6 +1610,9 @@ public struct PackExpansionExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `repeat`. public var repeatKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -1598,7 +1664,7 @@ public struct PackExpansionExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf /// ### Children /// -/// - `repeatKeyword`: `'repeat'` +/// - `repeatKeyword`: `repeat` /// - `repetitionPattern`: ``TypeSyntax`` public struct PackExpansionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -1660,6 +1726,9 @@ public struct PackExpansionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _Leaf } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `repeat`. public var repeatKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -1717,7 +1786,7 @@ public struct PackExpansionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _Leaf /// - `typeAnnotation`: ``TypeAnnotationSyntax``? /// - `initializer`: ``InitializerClauseSyntax``? /// - `accessorBlock`: ``AccessorBlockSyntax``? -/// - `trailingComma`: `','`? +/// - `trailingComma`: `,`? /// /// ### Contained in /// @@ -1892,6 +1961,9 @@ public struct PatternBindingSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var trailingComma: TokenSyntax? { get { return Syntax(self).child(at: 9)?.cast(TokenSyntax.self) @@ -2008,7 +2080,7 @@ public struct PatternExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy /// ### Children /// /// - `platformVersion`: ``PlatformVersionSyntax`` -/// - `trailingComma`: `','`? +/// - `trailingComma`: `,`? /// /// ### Contained in /// @@ -2093,6 +2165,10 @@ public struct PlatformVersionItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy } /// A trailing comma if the argument is followed by another argument + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var trailingComma: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -2198,6 +2274,10 @@ public struct PlatformVersionSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax } /// The name of the OS on which the availability should be restricted or 'swift' if the availability should be restricted based on a Swift version. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var platform: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -2447,6 +2527,9 @@ public struct PostfixOperatorExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Le } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var `operator`: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -2480,12 +2563,12 @@ public struct PostfixOperatorExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Le /// ### Children /// -/// - `fileLabel`: `'file'` -/// - `fileColon`: `':'` +/// - `fileLabel`: `file` +/// - `fileColon`: `:` /// - `fileName`: ``SimpleStringLiteralExprSyntax`` -/// - `comma`: `','` -/// - `lineLabel`: `'line'` -/// - `lineColon`: `':'` +/// - `comma`: `,` +/// - `lineLabel`: `line` +/// - `lineColon`: `:` /// - `lineNumber`: `` /// /// ### Contained in @@ -2581,6 +2664,9 @@ public struct PoundSourceLocationArgumentsSyntax: SyntaxProtocol, SyntaxHashable } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `file`. public var fileLabel: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -2599,6 +2685,9 @@ public struct PoundSourceLocationArgumentsSyntax: SyntaxProtocol, SyntaxHashable } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var fileColon: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -2635,6 +2724,9 @@ public struct PoundSourceLocationArgumentsSyntax: SyntaxProtocol, SyntaxHashable } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var comma: TokenSyntax { get { return Syntax(self).child(at: 7)!.cast(TokenSyntax.self) @@ -2653,6 +2745,9 @@ public struct PoundSourceLocationArgumentsSyntax: SyntaxProtocol, SyntaxHashable } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `line`. public var lineLabel: TokenSyntax { get { return Syntax(self).child(at: 9)!.cast(TokenSyntax.self) @@ -2671,6 +2766,9 @@ public struct PoundSourceLocationArgumentsSyntax: SyntaxProtocol, SyntaxHashable } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var lineColon: TokenSyntax { get { return Syntax(self).child(at: 11)!.cast(TokenSyntax.self) @@ -2689,6 +2787,9 @@ public struct PoundSourceLocationArgumentsSyntax: SyntaxProtocol, SyntaxHashable } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var lineNumber: TokenSyntax { get { return Syntax(self).child(at: 13)!.cast(TokenSyntax.self) @@ -2732,10 +2833,10 @@ public struct PoundSourceLocationArgumentsSyntax: SyntaxProtocol, SyntaxHashable /// ### Children /// -/// - `poundSourceLocation`: `'#sourceLocation'` -/// - `leftParen`: `'('` +/// - `poundSourceLocation`: `#sourceLocation` +/// - `leftParen`: `(` /// - `arguments`: ``PoundSourceLocationArgumentsSyntax``? -/// - `rightParen`: `')'` +/// - `rightParen`: `)` public struct PoundSourceLocationSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -2808,6 +2909,9 @@ public struct PoundSourceLocationSyntax: DeclSyntaxProtocol, SyntaxHashable, _Le } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `#sourceLocation`. public var poundSourceLocation: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -2826,6 +2930,9 @@ public struct PoundSourceLocationSyntax: DeclSyntaxProtocol, SyntaxHashable, _Le } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `(`. public var leftParen: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -2862,6 +2969,9 @@ public struct PoundSourceLocationSyntax: DeclSyntaxProtocol, SyntaxHashable, _Le } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `)`. public var rightParen: TokenSyntax { get { return Syntax(self).child(at: 7)!.cast(TokenSyntax.self) @@ -2901,9 +3011,9 @@ public struct PoundSourceLocationSyntax: DeclSyntaxProtocol, SyntaxHashable, _Le /// /// ### Children /// -/// - `assignmentLabel`: `'assignment'` -/// - `colon`: `':'` -/// - `value`: (`'true'` | `'false'`) +/// - `assignmentLabel`: `assignment` +/// - `colon`: `:` +/// - `value`: (`true` | `false`) /// /// ### Contained in /// @@ -2975,6 +3085,9 @@ public struct PrecedenceGroupAssignmentSyntax: SyntaxProtocol, SyntaxHashable, _ } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `assignment`. public var assignmentLabel: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -2993,6 +3106,9 @@ public struct PrecedenceGroupAssignmentSyntax: SyntaxProtocol, SyntaxHashable, _ } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -3012,6 +3128,12 @@ public struct PrecedenceGroupAssignmentSyntax: SyntaxProtocol, SyntaxHashable, _ } /// When true, an operator in the corresponding precedence group uses the same grouping rules during optional chaining as the assignment operators from the standard library. Otherwise, operators in the precedence group follows the same optional chaining rules as operators that don't perform assignment. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `true` + /// - `false` public var value: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -3049,9 +3171,9 @@ public struct PrecedenceGroupAssignmentSyntax: SyntaxProtocol, SyntaxHashable, _ /// /// ### Children /// -/// - `associativityLabel`: `'associativity'` -/// - `colon`: `':'` -/// - `value`: (`'left'` | `'right'` | `'none'`) +/// - `associativityLabel`: `associativity` +/// - `colon`: `:` +/// - `value`: (`left` | `right` | `none`) /// /// ### Contained in /// @@ -3123,6 +3245,9 @@ public struct PrecedenceGroupAssociativitySyntax: SyntaxProtocol, SyntaxHashable } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `associativity`. public var associativityLabel: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3141,6 +3266,9 @@ public struct PrecedenceGroupAssociativitySyntax: SyntaxProtocol, SyntaxHashable } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -3160,6 +3288,13 @@ public struct PrecedenceGroupAssociativitySyntax: SyntaxProtocol, SyntaxHashable } /// Operators that are `left`-associative group left-to-right. Operators that are `right`-associative group right-to-left. Operators that are specified with an associativity of `none` don't associate at all + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `left` + /// - `right` + /// - `none` public var value: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -3199,11 +3334,11 @@ public struct PrecedenceGroupAssociativitySyntax: SyntaxProtocol, SyntaxHashable /// /// - `attributes`: ``AttributeListSyntax`` /// - `modifiers`: ``DeclModifierListSyntax`` -/// - `precedencegroupKeyword`: `'precedencegroup'` +/// - `precedencegroupKeyword`: `precedencegroup` /// - `name`: `` -/// - `leftBrace`: `'{'` +/// - `leftBrace`: `{` /// - `groupAttributes`: ``PrecedenceGroupAttributeListSyntax`` -/// - `rightBrace`: `'}'` +/// - `rightBrace`: `}` public struct PrecedenceGroupDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -3390,6 +3525,9 @@ public struct PrecedenceGroupDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Le } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `precedencegroup`. public var precedencegroupKeyword: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -3409,6 +3547,10 @@ public struct PrecedenceGroupDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Le } /// The name of this precedence group. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var name: TokenSyntax { get { return Syntax(self).child(at: 7)!.cast(TokenSyntax.self) @@ -3427,6 +3569,9 @@ public struct PrecedenceGroupDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Le } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `{`. public var leftBrace: TokenSyntax { get { return Syntax(self).child(at: 9)!.cast(TokenSyntax.self) @@ -3491,6 +3636,9 @@ public struct PrecedenceGroupDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Le } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `}`. public var rightBrace: TokenSyntax { get { return Syntax(self).child(at: 13)!.cast(TokenSyntax.self) @@ -3535,7 +3683,7 @@ public struct PrecedenceGroupDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Le /// ### Children /// /// - `name`: `` -/// - `trailingComma`: `','`? +/// - `trailingComma`: `,`? /// /// ### Contained in /// @@ -3600,6 +3748,9 @@ public struct PrecedenceGroupNameSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var name: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3618,6 +3769,9 @@ public struct PrecedenceGroupNameSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var trailingComma: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -3653,8 +3807,8 @@ public struct PrecedenceGroupNameSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy /// /// ### Children /// -/// - `higherThanOrLowerThanLabel`: (`'higherThan'` | `'lowerThan'`) -/// - `colon`: `':'` +/// - `higherThanOrLowerThanLabel`: (`higherThan` | `lowerThan`) +/// - `colon`: `:` /// - `precedenceGroups`: ``PrecedenceGroupNameListSyntax`` /// /// ### Contained in @@ -3729,6 +3883,12 @@ public struct PrecedenceGroupRelationSyntax: SyntaxProtocol, SyntaxHashable, _Le } /// The relation to specified other precedence groups. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `higherThan` + /// - `lowerThan` public var higherThanOrLowerThanLabel: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3747,6 +3907,9 @@ public struct PrecedenceGroupRelationSyntax: SyntaxProtocol, SyntaxHashable, _Le } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -3890,6 +4053,9 @@ public struct PrefixOperatorExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var `operator`: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3941,9 +4107,9 @@ public struct PrefixOperatorExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea /// ### Children /// -/// - `leftAngle`: `'<'` +/// - `leftAngle`: `<` /// - `primaryAssociatedTypes`: ``PrimaryAssociatedTypeListSyntax`` -/// - `rightAngle`: `'>'` +/// - `rightAngle`: `>` /// /// ### Contained in /// @@ -4014,6 +4180,9 @@ public struct PrimaryAssociatedTypeClauseSyntax: SyntaxProtocol, SyntaxHashable, } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `<`. public var leftAngle: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -4077,6 +4246,9 @@ public struct PrimaryAssociatedTypeClauseSyntax: SyntaxProtocol, SyntaxHashable, } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `>`. public var rightAngle: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -4113,7 +4285,7 @@ public struct PrimaryAssociatedTypeClauseSyntax: SyntaxProtocol, SyntaxHashable, /// ### Children /// /// - `name`: `` -/// - `trailingComma`: `','`? +/// - `trailingComma`: `,`? /// /// ### Contained in /// @@ -4178,6 +4350,9 @@ public struct PrimaryAssociatedTypeSyntax: SyntaxProtocol, SyntaxHashable, _Leaf } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var name: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -4196,6 +4371,9 @@ public struct PrimaryAssociatedTypeSyntax: SyntaxProtocol, SyntaxHashable, _Leaf } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var trailingComma: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -4241,7 +4419,7 @@ public struct PrimaryAssociatedTypeSyntax: SyntaxProtocol, SyntaxHashable, _Leaf /// /// - `attributes`: ``AttributeListSyntax`` /// - `modifiers`: ``DeclModifierListSyntax`` -/// - `protocolKeyword`: `'protocol'` +/// - `protocolKeyword`: `protocol` /// - `name`: `` /// - `primaryAssociatedTypeClause`: ``PrimaryAssociatedTypeClauseSyntax``? /// - `inheritanceClause`: ``InheritanceClauseSyntax``? @@ -4444,6 +4622,10 @@ public struct ProtocolDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS } /// The `protocol` keyword for this declaration. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `protocol`. public var protocolKeyword: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -4463,6 +4645,10 @@ public struct ProtocolDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS } /// The name of the protocol. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var name: TokenSyntax { get { return Syntax(self).child(at: 7)!.cast(TokenSyntax.self) diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesQRS.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesQRS.swift index 9ddab3d3b12..147131a233d 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesQRS.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesQRS.swift @@ -17,9 +17,9 @@ /// ### Children /// /// - `openingPounds`: ``? -/// - `openingSlash`: `'/'` +/// - `openingSlash`: `/` /// - `regex`: `` -/// - `closingSlash`: `'/'` +/// - `closingSlash`: `/` /// - `closingPounds`: ``? public struct RegexLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -99,6 +99,9 @@ public struct RegexLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var openingPounds: TokenSyntax? { get { return Syntax(self).child(at: 1)?.cast(TokenSyntax.self) @@ -117,6 +120,9 @@ public struct RegexLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `/`. public var openingSlash: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -135,6 +141,9 @@ public struct RegexLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var regex: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -153,6 +162,9 @@ public struct RegexLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `/`. public var closingSlash: TokenSyntax { get { return Syntax(self).child(at: 7)!.cast(TokenSyntax.self) @@ -171,6 +183,9 @@ public struct RegexLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var closingPounds: TokenSyntax? { get { return Syntax(self).child(at: 9)?.cast(TokenSyntax.self) @@ -210,9 +225,9 @@ public struct RegexLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE /// ### Children /// -/// - `repeatKeyword`: `'repeat'` +/// - `repeatKeyword`: `repeat` /// - `body`: ``CodeBlockSyntax`` -/// - `whileKeyword`: `'while'` +/// - `whileKeyword`: `while` /// - `condition`: ``ExprSyntax`` public struct RepeatStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -286,6 +301,9 @@ public struct RepeatStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyn } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `repeat`. public var repeatKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -322,6 +340,9 @@ public struct RepeatStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyn } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `while`. public var whileKeyword: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -377,7 +398,7 @@ public struct RepeatStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyn /// ### Children /// -/// - `arrow`: `'->'` +/// - `arrow`: `->` /// - `type`: ``TypeSyntax`` /// /// ### Contained in @@ -446,6 +467,9 @@ public struct ReturnClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `->`. public var arrow: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -497,7 +521,7 @@ public struct ReturnClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod /// ### Children /// -/// - `returnKeyword`: `'return'` +/// - `returnKeyword`: `return` /// - `expression`: ``ExprSyntax``? public struct ReturnStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -559,6 +583,9 @@ public struct ReturnStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyn } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `return`. public var returnKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -701,6 +728,12 @@ public struct SameTypeRequirementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `` + /// - `` + /// - `` public var equal: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -857,9 +890,9 @@ public struct SequenceExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprS /// /// ### Children /// -/// - `openingQuote`: (`'"'` | `'"""'`) +/// - `openingQuote`: (`"` | `"""`) /// - `segments`: ``SimpleStringLiteralSegmentListSyntax`` -/// - `closingQuote`: (`'"'` | `'"""'`) +/// - `closingQuote`: (`"` | `"""`) /// /// ### Contained in /// @@ -935,6 +968,12 @@ public struct SimpleStringLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, } /// Open quote for the string literal + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `"` + /// - `"""` public var openingQuote: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -1000,6 +1039,12 @@ public struct SimpleStringLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, } /// Close quote for the string literal + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `"` + /// - `"""` public var closingQuote: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -1035,7 +1080,7 @@ public struct SimpleStringLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, /// ### Children /// -/// - `someOrAnySpecifier`: (`'some'` | `'any'`) +/// - `someOrAnySpecifier`: (`some` | `any`) /// - `constraint`: ``TypeSyntax`` public struct SomeOrAnyTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -1097,6 +1142,11 @@ public struct SomeOrAnyTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafType } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `some` + /// - `any` public var someOrAnySpecifier: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -1150,7 +1200,7 @@ public struct SomeOrAnyTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafType /// /// - `shebang`: ``? /// - `statements`: ``CodeBlockItemListSyntax`` -/// - `endOfFileToken`: `''` +/// - `endOfFileToken`: `` public struct SourceFileSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -1219,6 +1269,10 @@ public struct SourceFileSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodeP } /// A shebang can specify the path of the compiler when using Swift source file as a script. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var shebang: TokenSyntax? { get { return Syntax(self).child(at: 1)?.cast(TokenSyntax.self) @@ -1282,6 +1336,9 @@ public struct SourceFileSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodeP } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var endOfFileToken: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -1319,10 +1376,10 @@ public struct SourceFileSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodeP /// /// ### Children /// -/// - `availabilityLabel`: `'availability'` -/// - `colon`: `':'` +/// - `availabilityLabel`: `availability` +/// - `colon`: `:` /// - `availabilityArguments`: ``AvailabilityArgumentListSyntax`` -/// - `semicolon`: `';'` +/// - `semicolon`: `;` /// /// ### Contained in /// @@ -1402,6 +1459,10 @@ public struct SpecializeAvailabilityArgumentSyntax: SyntaxProtocol, SyntaxHashab } /// The label of the argument + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `availability`. public var availabilityLabel: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -1421,6 +1482,10 @@ public struct SpecializeAvailabilityArgumentSyntax: SyntaxProtocol, SyntaxHashab } /// The colon separating the label and the value + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -1484,6 +1549,9 @@ public struct SpecializeAvailabilityArgumentSyntax: SyntaxProtocol, SyntaxHashab } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `;`. public var semicolon: TokenSyntax { get { return Syntax(self).child(at: 7)!.cast(TokenSyntax.self) @@ -1523,10 +1591,10 @@ public struct SpecializeAvailabilityArgumentSyntax: SyntaxProtocol, SyntaxHashab /// /// ### Children /// -/// - `targetLabel`: `'target'` -/// - `colon`: `':'` +/// - `targetLabel`: `target` +/// - `colon`: `:` /// - `declName`: ``DeclReferenceExprSyntax`` -/// - `trailingComma`: `','`? +/// - `trailingComma`: `,`? /// /// ### Contained in /// @@ -1608,6 +1676,10 @@ public struct SpecializeTargetFunctionArgumentSyntax: SyntaxProtocol, SyntaxHash } /// The label of the argument + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `target`. public var targetLabel: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -1627,6 +1699,10 @@ public struct SpecializeTargetFunctionArgumentSyntax: SyntaxProtocol, SyntaxHash } /// The colon separating the label and the value + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -1665,6 +1741,10 @@ public struct SpecializeTargetFunctionArgumentSyntax: SyntaxProtocol, SyntaxHash } /// A trailing comma if this argument is followed by another one + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var trailingComma: TokenSyntax? { get { return Syntax(self).child(at: 7)?.cast(TokenSyntax.self) @@ -1703,9 +1783,9 @@ public struct SpecializeTargetFunctionArgumentSyntax: SyntaxProtocol, SyntaxHash /// ### Children /// /// - `openingPounds`: ``? -/// - `openingQuote`: (`'"'` | `'"""'` | `'''`) +/// - `openingQuote`: (`"` | `"""` | `'`) /// - `segments`: ``StringLiteralSegmentListSyntax`` -/// - `closingQuote`: (`'"'` | `'"""'` | `'''`) +/// - `closingQuote`: (`"` | `"""` | `'`) /// - `closingPounds`: ``? /// /// ### Contained in @@ -1796,6 +1876,9 @@ public struct StringLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var openingPounds: TokenSyntax? { get { return Syntax(self).child(at: 1)?.cast(TokenSyntax.self) @@ -1814,6 +1897,12 @@ public struct StringLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `"` + /// - `"""` + /// - `'` public var openingQuote: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -1877,6 +1966,12 @@ public struct StringLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `"` + /// - `"""` + /// - `'` public var closingQuote: TokenSyntax { get { return Syntax(self).child(at: 7)!.cast(TokenSyntax.self) @@ -1895,6 +1990,9 @@ public struct StringLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var closingPounds: TokenSyntax? { get { return Syntax(self).child(at: 9)?.cast(TokenSyntax.self) @@ -1986,6 +2084,9 @@ public struct StringSegmentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNo } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var content: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -2073,7 +2174,7 @@ public struct StringSegmentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNo /// /// - `attributes`: ``AttributeListSyntax`` /// - `modifiers`: ``DeclModifierListSyntax`` -/// - `structKeyword`: `'struct'` +/// - `structKeyword`: `struct` /// - `name`: `` /// - `genericParameterClause`: ``GenericParameterClauseSyntax``? /// - `inheritanceClause`: ``InheritanceClauseSyntax``? @@ -2276,6 +2377,10 @@ public struct StructDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyn } /// The `struct` keyword for this declaration. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `struct`. public var structKeyword: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -2295,6 +2400,10 @@ public struct StructDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyn } /// Declares the name of this struct. If the name matches a reserved keyword use backticks to escape it. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var name: TokenSyntax { get { return Syntax(self).child(at: 7)!.cast(TokenSyntax.self) @@ -2417,9 +2526,9 @@ public struct StructDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyn /// ### Children /// /// - `calledExpression`: ``ExprSyntax`` -/// - `leftSquare`: `'['` +/// - `leftSquare`: `[` /// - `arguments`: ``LabeledExprListSyntax`` -/// - `rightSquare`: `']'` +/// - `rightSquare`: `]` /// - `trailingClosure`: ``ClosureExprSyntax``? /// - `additionalTrailingClosures`: ``MultipleTrailingClosureElementListSyntax`` public struct SubscriptCallExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxNodeProtocol { @@ -2524,6 +2633,9 @@ public struct SubscriptCallExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `[`. public var leftSquare: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -2587,6 +2699,9 @@ public struct SubscriptCallExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `]`. public var rightSquare: TokenSyntax { get { return Syntax(self).child(at: 7)!.cast(TokenSyntax.self) @@ -2693,7 +2808,7 @@ public struct SubscriptCallExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf /// /// - `attributes`: ``AttributeListSyntax`` /// - `modifiers`: ``DeclModifierListSyntax`` -/// - `subscriptKeyword`: `'subscript'` +/// - `subscriptKeyword`: `subscript` /// - `genericParameterClause`: ``GenericParameterClauseSyntax``? /// - `parameterClause`: ``FunctionParameterClauseSyntax`` /// - `returnClause`: ``ReturnClauseSyntax`` @@ -2887,6 +3002,9 @@ public struct SubscriptDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `subscript`. public var subscriptKeyword: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -3024,7 +3142,7 @@ public struct SubscriptDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl /// ### Children /// -/// - `superKeyword`: `'super'` +/// - `superKeyword`: `super` public struct SuperExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -3071,6 +3189,9 @@ public struct SuperExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `super`. public var superKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3160,6 +3281,9 @@ public struct SuppressedTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var withoutTilde: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3213,7 +3337,7 @@ public struct SuppressedTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp /// /// - `pattern`: ``PatternSyntax`` /// - `whereClause`: ``WhereClauseSyntax``? -/// - `trailingComma`: `','`? +/// - `trailingComma`: `,`? /// /// ### Contained in /// @@ -3320,6 +3444,9 @@ public struct SwitchCaseItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var trailingComma: TokenSyntax? { get { return Syntax(self).child(at: 5)?.cast(TokenSyntax.self) @@ -3355,9 +3482,9 @@ public struct SwitchCaseItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN /// ### Children /// -/// - `caseKeyword`: `'case'` +/// - `caseKeyword`: `case` /// - `caseItems`: ``SwitchCaseItemListSyntax`` -/// - `colon`: `':'` +/// - `colon`: `:` /// /// ### Contained in /// @@ -3428,6 +3555,9 @@ public struct SwitchCaseLabelSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `case`. public var caseKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3491,6 +3621,9 @@ public struct SwitchCaseLabelSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -3737,8 +3870,8 @@ public struct SwitchCaseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodeP /// ### Children /// -/// - `defaultKeyword`: `'default'` -/// - `colon`: `':'` +/// - `defaultKeyword`: `default` +/// - `colon`: `:` /// /// ### Contained in /// @@ -3803,6 +3936,9 @@ public struct SwitchDefaultLabelSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `default`. public var defaultKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3821,6 +3957,9 @@ public struct SwitchDefaultLabelSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -3854,11 +3993,11 @@ public struct SwitchDefaultLabelSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn /// ### Children /// -/// - `switchKeyword`: `'switch'` +/// - `switchKeyword`: `switch` /// - `subject`: ``ExprSyntax`` -/// - `leftBrace`: `'{'` +/// - `leftBrace`: `{` /// - `cases`: ``SwitchCaseListSyntax`` -/// - `rightBrace`: `'}'` +/// - `rightBrace`: `}` public struct SwitchExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -3937,6 +4076,9 @@ public struct SwitchExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyn } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `switch`. public var switchKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3973,6 +4115,9 @@ public struct SwitchExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyn } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `{`. public var leftBrace: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -4036,6 +4181,9 @@ public struct SwitchExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyn } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `}`. public var rightBrace: TokenSyntax { get { return Syntax(self).child(at: 9)!.cast(TokenSyntax.self) diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesTUVWXYZ.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesTUVWXYZ.swift index cfd4d0d8c9a..7d258ce646a 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesTUVWXYZ.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesTUVWXYZ.swift @@ -17,9 +17,9 @@ /// ### Children /// /// - `condition`: ``ExprSyntax`` -/// - `questionMark`: `'?'` +/// - `questionMark`: `?` /// - `thenExpression`: ``ExprSyntax`` -/// - `colon`: `':'` +/// - `colon`: `:` /// - `elseExpression`: ``ExprSyntax`` public struct TernaryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -117,6 +117,9 @@ public struct TernaryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `?`. public var questionMark: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -153,6 +156,9 @@ public struct TernaryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax { get { return Syntax(self).child(at: 7)!.cast(TokenSyntax.self) @@ -218,7 +224,7 @@ public struct TernaryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy /// /// ### Children /// -/// - `thenKeyword`: `'then'` +/// - `thenKeyword`: `then` /// - `expression`: ``ExprSyntax`` public struct ThenStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -280,6 +286,9 @@ public struct ThenStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynta } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `then`. public var thenKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -331,7 +340,7 @@ public struct ThenStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynta /// ### Children /// -/// - `throwKeyword`: `'throw'` +/// - `throwKeyword`: `throw` /// - `expression`: ``ExprSyntax`` public struct ThrowStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -393,6 +402,9 @@ public struct ThrowStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `throw`. public var throwKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -444,8 +456,8 @@ public struct ThrowStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt /// ### Children /// -/// - `tryKeyword`: `'try'` -/// - `questionOrExclamationMark`: (`'?'` | `'!'`)? +/// - `tryKeyword`: `try` +/// - `questionOrExclamationMark`: (`?` | `!`)? /// - `expression`: ``ExprSyntax`` public struct TryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -513,6 +525,9 @@ public struct TryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntax } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `try`. public var tryKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -531,6 +546,11 @@ public struct TryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntax } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `?` + /// - `!` public var questionOrExclamationMark: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -584,9 +604,9 @@ public struct TryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntax /// ### Children /// -/// - `leftParen`: `'('` +/// - `leftParen`: `(` /// - `elements`: ``LabeledExprListSyntax`` -/// - `rightParen`: `')'` +/// - `rightParen`: `)` public struct TupleExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -653,6 +673,9 @@ public struct TupleExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `(`. public var leftParen: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -716,6 +739,9 @@ public struct TupleExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `)`. public var rightParen: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -752,9 +778,9 @@ public struct TupleExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt /// ### Children /// /// - `label`: ``? -/// - `colon`: `':'`? +/// - `colon`: `:`? /// - `pattern`: ``PatternSyntax`` -/// - `trailingComma`: `','`? +/// - `trailingComma`: `,`? /// /// ### Contained in /// @@ -831,6 +857,9 @@ public struct TuplePatternElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var label: TokenSyntax? { get { return Syntax(self).child(at: 1)?.cast(TokenSyntax.self) @@ -849,6 +878,9 @@ public struct TuplePatternElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -885,6 +917,9 @@ public struct TuplePatternElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var trailingComma: TokenSyntax? { get { return Syntax(self).child(at: 7)?.cast(TokenSyntax.self) @@ -922,9 +957,9 @@ public struct TuplePatternElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy /// ### Children /// -/// - `leftParen`: `'('` +/// - `leftParen`: `(` /// - `elements`: ``TuplePatternElementListSyntax`` -/// - `rightParen`: `')'` +/// - `rightParen`: `)` public struct TuplePatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _LeafPatternSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -991,6 +1026,9 @@ public struct TuplePatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _LeafPa } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `(`. public var leftParen: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -1054,6 +1092,9 @@ public struct TuplePatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _LeafPa } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `)`. public var rightParen: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -1089,13 +1130,13 @@ public struct TuplePatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _LeafPa /// ### Children /// -/// - `inoutKeyword`: `'inout'`? -/// - `firstName`: (`` | `'_'`)? -/// - `secondName`: (`` | `'_'`)? -/// - `colon`: `':'`? +/// - `inoutKeyword`: `inout`? +/// - `firstName`: (`` | `_`)? +/// - `secondName`: (`` | `_`)? +/// - `colon`: `:`? /// - `type`: ``TypeSyntax`` -/// - `ellipsis`: `'...'`? -/// - `trailingComma`: `','`? +/// - `ellipsis`: `...`? +/// - `trailingComma`: `,`? /// /// ### Contained in /// @@ -1190,6 +1231,9 @@ public struct TupleTypeElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `inout`. public var inoutKeyword: TokenSyntax? { get { return Syntax(self).child(at: 1)?.cast(TokenSyntax.self) @@ -1208,6 +1252,11 @@ public struct TupleTypeElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `` + /// - `_` public var firstName: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -1226,6 +1275,11 @@ public struct TupleTypeElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `` + /// - `_` public var secondName: TokenSyntax? { get { return Syntax(self).child(at: 5)?.cast(TokenSyntax.self) @@ -1244,6 +1298,9 @@ public struct TupleTypeElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax? { get { return Syntax(self).child(at: 7)?.cast(TokenSyntax.self) @@ -1280,6 +1337,9 @@ public struct TupleTypeElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `...`. public var ellipsis: TokenSyntax? { get { return Syntax(self).child(at: 11)?.cast(TokenSyntax.self) @@ -1298,6 +1358,9 @@ public struct TupleTypeElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var trailingComma: TokenSyntax? { get { return Syntax(self).child(at: 13)?.cast(TokenSyntax.self) @@ -1341,9 +1404,9 @@ public struct TupleTypeElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta /// ### Children /// -/// - `leftParen`: `'('` +/// - `leftParen`: `(` /// - `elements`: ``TupleTypeElementListSyntax`` -/// - `rightParen`: `')'` +/// - `rightParen`: `)` public struct TupleTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -1410,6 +1473,9 @@ public struct TupleTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `(`. public var leftParen: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -1473,6 +1539,9 @@ public struct TupleTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `)`. public var rightParen: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -1510,7 +1579,7 @@ public struct TupleTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSynt /// /// - `attributes`: ``AttributeListSyntax`` /// - `modifiers`: ``DeclModifierListSyntax`` -/// - `typealiasKeyword`: `'typealias'` +/// - `typealiasKeyword`: `typealias` /// - `name`: `` /// - `genericParameterClause`: ``GenericParameterClauseSyntax``? /// - `initializer`: ``TypeInitializerClauseSyntax`` @@ -1697,6 +1766,9 @@ public struct TypeAliasDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `typealias`. public var typealiasKeyword: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -1715,6 +1787,9 @@ public struct TypeAliasDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var name: TokenSyntax { get { return Syntax(self).child(at: 7)!.cast(TokenSyntax.self) @@ -1814,7 +1889,7 @@ public struct TypeAliasDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl /// ### Children /// -/// - `colon`: `':'` +/// - `colon`: `:` /// - `type`: ``TypeSyntax`` /// /// ### Contained in @@ -1884,6 +1959,9 @@ public struct TypeAnnotationSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -1935,8 +2013,8 @@ public struct TypeAnnotationSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxN /// ### Children /// -/// - `asyncSpecifier`: `'async'`? -/// - `throwsSpecifier`: `'throws'`? +/// - `asyncSpecifier`: `async`? +/// - `throwsSpecifier`: `throws`? /// /// ### Contained in /// @@ -2003,6 +2081,9 @@ public struct TypeEffectSpecifiersSyntax: SyntaxProtocol, SyntaxHashable, _LeafS } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `async`. public var asyncSpecifier: TokenSyntax? { get { return Syntax(self).child(at: 1)?.cast(TokenSyntax.self) @@ -2021,6 +2102,9 @@ public struct TypeEffectSpecifiersSyntax: SyntaxProtocol, SyntaxHashable, _LeafS } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `throws`. public var throwsSpecifier: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -2128,7 +2212,7 @@ public struct TypeExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynta /// ### Children /// -/// - `equal`: `'='` +/// - `equal`: `=` /// - `value`: ``TypeSyntax`` /// /// ### Contained in @@ -2195,6 +2279,9 @@ public struct TypeInitializerClauseSyntax: SyntaxProtocol, SyntaxHashable, _Leaf } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `=`. public var equal: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -2248,8 +2335,8 @@ public struct TypeInitializerClauseSyntax: SyntaxProtocol, SyntaxHashable, _Leaf /// /// ### Children /// -/// - `messageLabel`: `'message'` -/// - `colon`: `':'` +/// - `messageLabel`: `message` +/// - `colon`: `:` /// - `message`: ``StringLiteralExprSyntax`` /// /// ### Contained in @@ -2321,6 +2408,9 @@ public struct UnavailableFromAsyncAttributeArgumentsSyntax: SyntaxProtocol, Synt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `message`. public var messageLabel: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -2339,6 +2429,9 @@ public struct UnavailableFromAsyncAttributeArgumentsSyntax: SyntaxProtocol, Synt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -2394,8 +2487,8 @@ public struct UnavailableFromAsyncAttributeArgumentsSyntax: SyntaxProtocol, Synt /// /// ### Children /// -/// - `sourceFileLabel`: `'sourceFile'` -/// - `colon`: `':'` +/// - `sourceFileLabel`: `sourceFile` +/// - `colon`: `:` /// - `filename`: ``StringLiteralExprSyntax`` /// /// ### Contained in @@ -2467,6 +2560,9 @@ public struct UnderscorePrivateAttributeArgumentsSyntax: SyntaxProtocol, SyntaxH } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `sourceFile`. public var sourceFileLabel: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -2485,6 +2581,9 @@ public struct UnderscorePrivateAttributeArgumentsSyntax: SyntaxProtocol, SyntaxH } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -2538,8 +2637,8 @@ public struct UnderscorePrivateAttributeArgumentsSyntax: SyntaxProtocol, SyntaxH /// ### Children /// -/// - `asKeyword`: `'as'` -/// - `questionOrExclamationMark`: (`'?'` | `'!'`)? +/// - `asKeyword`: `as` +/// - `questionOrExclamationMark`: (`?` | `!`)? public struct UnresolvedAsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -2600,6 +2699,9 @@ public struct UnresolvedAsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `as`. public var asKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -2618,6 +2720,11 @@ public struct UnresolvedAsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `?` + /// - `!` public var questionOrExclamationMark: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -2651,7 +2758,7 @@ public struct UnresolvedAsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE /// ### Children /// -/// - `isKeyword`: `'is'` +/// - `isKeyword`: `is` public struct UnresolvedIsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -2698,6 +2805,9 @@ public struct UnresolvedIsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `is`. public var isKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -2725,9 +2835,9 @@ public struct UnresolvedIsExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE /// ### Children /// -/// - `questionMark`: `'?'` +/// - `questionMark`: `?` /// - `thenExpression`: ``ExprSyntax`` -/// - `colon`: `':'` +/// - `colon`: `:` public struct UnresolvedTernaryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -2794,6 +2904,9 @@ public struct UnresolvedTernaryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _ } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `?`. public var questionMark: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -2830,6 +2943,9 @@ public struct UnresolvedTernaryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _ } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `:`. public var colon: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -2865,7 +2981,7 @@ public struct UnresolvedTernaryExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _ /// ### Children /// -/// - `bindingSpecifier`: (`'let'` | `'var'` | `'inout'` | `'_mutating'` | `'_borrowing'` | `'_consuming'`) +/// - `bindingSpecifier`: (`let` | `var` | `inout` | `_mutating` | `_borrowing` | `_consuming`) /// - `pattern`: ``PatternSyntax`` public struct ValueBindingPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _LeafPatternSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -2927,6 +3043,15 @@ public struct ValueBindingPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `let` + /// - `var` + /// - `inout` + /// - `_mutating` + /// - `_borrowing` + /// - `_consuming` public var bindingSpecifier: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -2985,7 +3110,7 @@ public struct ValueBindingPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, /// /// - `attributes`: ``AttributeListSyntax`` /// - `modifiers`: ``DeclModifierListSyntax`` -/// - `bindingSpecifier`: (`'let'` | `'var'` | `'inout'` | `'_mutating'` | `'_borrowing'` | `'_consuming'`) +/// - `bindingSpecifier`: (`let` | `var` | `inout` | `_mutating` | `_borrowing` | `_consuming`) /// - `bindings`: ``PatternBindingListSyntax`` public struct VariableDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -3152,6 +3277,16 @@ public struct VariableDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS } /// The specifier that defines the type of the variables declared (`let` or `var`). + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds: + /// - `let` + /// - `var` + /// - `inout` + /// - `_mutating` + /// - `_borrowing` + /// - `_consuming` public var bindingSpecifier: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self) @@ -3247,7 +3382,7 @@ public struct VariableDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS /// /// ### Children /// -/// - `period`: `'.'` +/// - `period`: `.` /// - `number`: `` /// /// ### Contained in @@ -3316,6 +3451,10 @@ public struct VersionComponentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta } /// The period of this version component + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `.`. public var period: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3335,6 +3474,10 @@ public struct VersionComponentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta } /// The version number of this component + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var number: TokenSyntax { get { return Syntax(self).child(at: 3)!.cast(TokenSyntax.self) @@ -3441,6 +3584,10 @@ public struct VersionTupleSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod } /// The major version. + /// + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be ``. public var major: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3520,7 +3667,7 @@ public struct VersionTupleSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod /// ### Children /// -/// - `whereKeyword`: `'where'` +/// - `whereKeyword`: `where` /// - `condition`: ``ExprSyntax`` /// /// ### Contained in @@ -3588,6 +3735,9 @@ public struct WhereClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `where`. public var whereKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3639,7 +3789,7 @@ public struct WhereClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode /// ### Children /// -/// - `whileKeyword`: `'while'` +/// - `whileKeyword`: `while` /// - `conditions`: ``ConditionElementListSyntax`` /// - `body`: ``CodeBlockSyntax`` public struct WhileStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntaxNodeProtocol { @@ -3708,6 +3858,9 @@ public struct WhileStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `while`. public var whileKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3806,7 +3959,7 @@ public struct WhileStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt /// ### Children /// -/// - `wildcard`: `'_'` +/// - `wildcard`: `_` /// - `typeAnnotation`: ``TypeAnnotationSyntax``? public struct WildcardPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _LeafPatternSyntaxNodeProtocol { public let _syntaxNode: Syntax @@ -3868,6 +4021,9 @@ public struct WildcardPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _Lea } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `_`. public var wildcard: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -3919,7 +4075,7 @@ public struct WildcardPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _Lea /// ### Children /// -/// - `yieldKeyword`: `'yield'` +/// - `yieldKeyword`: `yield` /// - `yieldedExpressions`: (``YieldedExpressionsClauseSyntax`` | ``ExprSyntax``) public struct YieldStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntaxNodeProtocol { public enum YieldedExpressions: SyntaxChildChoices, SyntaxHashable { @@ -4019,6 +4175,9 @@ public struct YieldStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `yield`. public var yieldKeyword: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -4071,7 +4230,7 @@ public struct YieldStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt /// ### Children /// /// - `expression`: ``ExprSyntax`` -/// - `comma`: `','`? +/// - `comma`: `,`? /// /// ### Contained in /// @@ -4154,6 +4313,9 @@ public struct YieldedExpressionSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `,`. public var comma: TokenSyntax? { get { return Syntax(self).child(at: 3)?.cast(TokenSyntax.self) @@ -4187,9 +4349,9 @@ public struct YieldedExpressionSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt /// ### Children /// -/// - `leftParen`: `'('` +/// - `leftParen`: `(` /// - `elements`: ``YieldedExpressionListSyntax`` -/// - `rightParen`: `')'` +/// - `rightParen`: `)` /// /// ### Contained in /// @@ -4260,6 +4422,9 @@ public struct YieldedExpressionsClauseSyntax: SyntaxProtocol, SyntaxHashable, _L } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `(`. public var leftParen: TokenSyntax { get { return Syntax(self).child(at: 1)!.cast(TokenSyntax.self) @@ -4323,6 +4488,9 @@ public struct YieldedExpressionsClauseSyntax: SyntaxProtocol, SyntaxHashable, _L } } + /// ### Tokens + /// + /// For syntax trees generated by the parser, this is guaranteed to be `)`. public var rightParen: TokenSyntax { get { return Syntax(self).child(at: 5)!.cast(TokenSyntax.self)