TokenSyntax
A Syntax node representing a single token.
struct TokenSyntax
A Syntax node representing a single token.
struct TokenSyntax
init?(Syntax)
Converts the given Syntax
node to a TokenSyntax
if possible. Returns nil
if the conversion is not possible.
init(TokenKind, leadingTrivia: Trivia, trailingTrivia: Trivia, presence: SourcePresence)
static var any: TokenSyntax
The Any
keyword
static var arrow: TokenSyntax
The ->
token
static var `as`: TokenSyntax
The as
keyword
static var `associatedtype`: TokenSyntax
The associatedtype
keyword
static var atSign: TokenSyntax
The @
token
static var backslash: TokenSyntax
The \
token
static var backtick: TokenSyntax
The ``` token
static var `break`: TokenSyntax
The break
keyword
static var capitalSelf: TokenSyntax
The Self
keyword
static var `case`: TokenSyntax
The case
keyword
static var `catch`: TokenSyntax
The catch
keyword
static var `class`: TokenSyntax
The class
keyword
static var colon: TokenSyntax
The :
token
static var comma: TokenSyntax
The ,
token
static var `continue`: TokenSyntax
The continue
keyword
static var `default`: TokenSyntax
The default
keyword
static var `defer`: TokenSyntax
The defer
keyword
static var `deinit`: TokenSyntax
The deinit
keyword
static var `do`: TokenSyntax
The do
keyword
static var ellipsis: TokenSyntax
The ...
token
static var `else`: TokenSyntax
The else
keyword
static var `enum`: TokenSyntax
The enum
keyword
static var eof: TokenSyntax
The eof
token
static var equal: TokenSyntax
The =
token
static var exclamationMark: TokenSyntax
The !
token
static var `extension`: TokenSyntax
The extension
keyword
static var `fallthrough`: TokenSyntax
The fallthrough
keyword
static var `false`: TokenSyntax
The false
keyword
static var `fileprivate`: TokenSyntax
The fileprivate
keyword
static var `for`: TokenSyntax
The for
keyword
static var `func`: TokenSyntax
The func
keyword
static var `guard`: TokenSyntax
The guard
keyword
static var `if`: TokenSyntax
The if
keyword
static var `import`: TokenSyntax
The import
keyword
static var `in`: TokenSyntax
The in
keyword
static var infixQuestionMark: TokenSyntax
The ?
token
static var `init`: TokenSyntax
The init
keyword
static var `inout`: TokenSyntax
The inout
keyword
static var `internal`: TokenSyntax
The internal
keyword
static var `is`: TokenSyntax
The is
keyword
static var leftAngle: TokenSyntax
The <
token
static var leftBrace: TokenSyntax
The {
token
static var leftParen: TokenSyntax
The (
token
static var leftSquareBracket: TokenSyntax
The [
token
static var `let`: TokenSyntax
The let
keyword
static var multilineStringQuote: TokenSyntax
The """
token
static var `nil`: TokenSyntax
The nil
keyword
static var open: TokenSyntax
The open
contextual token
static var `operator`: TokenSyntax
The operator
keyword
static var period: TokenSyntax
The .
token
static var postfixQuestionMark: TokenSyntax
The ?
token
static var pound: TokenSyntax
The #
token
static var poundAssert: TokenSyntax
The #assert
keyword
static var poundAvailable: TokenSyntax
The #available
keyword
static var poundColorLiteral: TokenSyntax
The #colorLiteral
keyword
static var poundColumn: TokenSyntax
The #column
keyword
static var poundDsohandle: TokenSyntax
The #dsohandle
keyword
static var poundElse: TokenSyntax
The #else
keyword
static var poundElseif: TokenSyntax
The #elseif
keyword
static var poundEndif: TokenSyntax
The #endif
keyword
static var poundError: TokenSyntax
The #error
keyword
static var poundFile: TokenSyntax
The #file
keyword
static var poundFileID: TokenSyntax
The #fileID
keyword
static var poundFileLiteral: TokenSyntax
The #fileLiteral
keyword
static var poundFilePath: TokenSyntax
The #filePath
keyword
static var poundFunction: TokenSyntax
The #function
keyword
static var poundIf: TokenSyntax
The #if
keyword
static var poundImageLiteral: TokenSyntax
The #imageLiteral
keyword
static var poundKeyPath: TokenSyntax
The #keyPath
keyword
static var poundLine: TokenSyntax
The #line
keyword
static var poundSelector: TokenSyntax
The #selector
keyword
static var poundSourceLocation: TokenSyntax
The #sourceLocation
keyword
static var poundUnavailable: TokenSyntax
The #unavailable
keyword
static var poundWarning: TokenSyntax
The #warning
keyword
static var `precedencegroup`: TokenSyntax
The precedencegroup
keyword
static var prefixAmpersand: TokenSyntax
The &
token
static var prefixPeriod: TokenSyntax
The .
token
static var `private`: TokenSyntax
The private
keyword
static var `protocol`: TokenSyntax
The protocol
keyword
static var `public`: TokenSyntax
The public
keyword
static var `repeat`: TokenSyntax
The repeat
keyword
static var `rethrows`: TokenSyntax
The rethrows
keyword
static var `return`: TokenSyntax
The return
keyword
static var rightAngle: TokenSyntax
The >
token
static var rightBrace: TokenSyntax
The }
token
static var rightParen: TokenSyntax
The )
token
static var rightSquareBracket: TokenSyntax
The ]
token
static var `self`: TokenSyntax
The self
keyword
static var semicolon: TokenSyntax
The ;
token
static var singleQuote: TokenSyntax
The '
token
static var `static`: TokenSyntax
The static
keyword
static var stringInterpolationAnchor: TokenSyntax
The )
token
static var stringQuote: TokenSyntax
The "
token
static var `struct`: TokenSyntax
The struct
keyword
static var `subscript`: TokenSyntax
The subscript
keyword
static var `super`: TokenSyntax
The super
keyword
static var `switch`: TokenSyntax
The switch
keyword
static var `throw`: TokenSyntax
The throw
keyword
static var `throws`: TokenSyntax
The throws
keyword
static var `true`: TokenSyntax
The true
keyword
static var `try`: TokenSyntax
The try
keyword
static var `typealias`: TokenSyntax
The typealias
keyword
static var `var`: TokenSyntax
The var
keyword
static var `where`: TokenSyntax
The where
keyword
static var `while`: TokenSyntax
The while
keyword
static var wildcard: TokenSyntax
The _
keyword
static var yield: TokenSyntax
The yield
token
var byteRange: ByteSourceRange
The byte source range of this node including leading and trailing trivia.
var byteSize: Int
The textual byte length of this node including leading and trailing trivia.
var byteSizeAfterTrimmingTrivia: Int
The textual byte length of this node exluding leading and trailing trivia.
var classifications: SyntaxClassifications
Sequence of SyntaxClassifiedRange
s for this syntax node.
var contentLength: SourceLength
The length this node takes up spelled out in the source, excluding its leading or trailing trivia.
var contentLength: SourceLength
The length this node takes up spelled out in the source, excluding its leading or trailing trivia.
var customMirror: Mirror
The custom mirror for this instance.
var debugDescription: String
A simple description of this node (ie. its type).
var description: String
A source-accurate description of this node.
var endPosition: AbsolutePosition
The end position of this node, including its trivia.
var endPositionBeforeTrailingTrivia: AbsolutePosition
The end position of this node’s content, before any trailing trivia.
var firstToken: TokenSyntax?
Returns the first token in this syntax node in the source accurate view of the syntax tree.
var halfWidthCornerQuoted: String
var hasParent: Bool
Whether or not this node has a parent.
var id: SyntaxIdentifier
Returns a value representing the unique identity of the node.
var index: SyntaxChildrenIndex
The index of this node in a SyntaxChildren
collection.
var indexInParent: Int
The index of this node in the parent’s children.
var isCollection: Bool
Whether or not this node represents an SyntaxCollection.
var isImplicit: Bool
When isImplicit is true, the syntax node doesn’t include any underlying tokens, e.g. an empty CodeBlockItemList.
var isMissing: Bool
Whether or not this node is marked as missing
.
var isPresent: Bool
Whether or not this node is marked as present
.
var isToken: Bool
Whether or not this node is a token one.
var isUnknown: Bool
Whether or not this node represents an unknown node.
var lastToken: TokenSyntax?
Returns the last token node that is part of this syntax node.
var leadingTrivia: Trivia?
The leading trivia of this syntax node. Leading trivia is attached to the first token syntax contained by this node. Without such token, this property will return nil.
var leadingTrivia: Trivia
The leading trivia (spaces, newlines, etc.) associated with this token.
var leadingTriviaLength: SourceLength
The length this node’s leading trivia takes up spelled out in source.
var leadingTriviaLength: SourceLength
The length this node’s leading trivia takes up spelled out in source.
var nextToken: TokenSyntax?
Recursively walks through the tree to find the next token semantically after this node.
var parent: Syntax?
The parent of this syntax node, or nil
if this node is the root.
var position: AbsolutePosition
The absolute position of the starting point of this node. If the first token is with leading trivia, the position points to the start of the leading trivia.
var positionAfterSkippingLeadingTrivia: AbsolutePosition
The absolute position of the starting point of this node, skipping any leading trivia attached to the first token syntax.
var presence: SourcePresence
var previousToken: TokenSyntax?
Recursively walks through the tree to find the token semantically before this node.
var recursiveDescription: String
Same as debugDescription
but includes all children.
var root: Syntax
The root of the tree in which this node resides.
var syntaxNodeType: SyntaxProtocol.Type
Returns the underlying syntax node type.
var text: String
The text of the token as written in the source code.
var tokenClassification: SyntaxClassifiedRange
The SyntaxClassifiedRange
for the token text, excluding trivia.
var tokenKind: TokenKind
The kind of token this node represents.
var totalLength: SourceLength
The length of this node including all of its trivia.
var totalLength: SourceLength
The length of this node including all of its trivia.
var trailingTrivia: Trivia?
The trailing trivia of this syntax node. Trailing trivia is attached to the last token syntax contained by this node. Without such token, this property will return nil.
var trailingTrivia: Trivia
The trailing trivia (spaces, newlines, etc.) associated with this token.
var trailingTriviaLength: SourceLength
The length this node’s trailing trivia takes up spelled out in source.
var trailingTriviaLength: SourceLength
The length this node’s trailing trivia takes up spelled out in source.
static func anyKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func arrowToken(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func asKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func associatedtypeKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func atSignToken(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func backslashToken(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func backtickToken(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func breakKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func capitalSelfKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func caseKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func catchKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func classKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func colonToken(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func commaToken(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func contextualKeyword(String, leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func continueKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func defaultKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func deferKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func deinitKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func doKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func dollarIdentifier(String, leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func ellipsisToken(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func elseKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func enumKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func eof(leadingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func equalToken(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func exclamationMarkToken(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func extensionKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func fallthroughKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func falseKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func fileprivateKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func floatingLiteral(String, leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func forKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func funcKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func guardKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func identifier(String, leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func ifKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func importKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func inKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func infixQuestionMarkToken(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func initKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func inoutKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func integerLiteral(String, leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func internalKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func isKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func leftAngleToken(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func leftBraceToken(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func leftParenToken(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func leftSquareBracketToken(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func letKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func multilineStringQuoteToken(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func nilKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func operatorKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func periodToken(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func postfixOperator(String, leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func postfixQuestionMarkToken(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func poundAssertKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func poundAvailableKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func poundColorLiteralKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func poundColumnKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func poundDsohandleKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func poundElseKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func poundElseifKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func poundEndifKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func poundErrorKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func poundFileIDKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func poundFileKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func poundFileLiteralKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func poundFilePathKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func poundFunctionKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func poundIfKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func poundImageLiteralKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func poundKeyPathKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func poundLineKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func poundSelectorKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func poundSourceLocationKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func poundToken(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func poundUnavailableKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func poundWarningKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func precedencegroupKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func prefixAmpersandToken(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func prefixOperator(String, leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func prefixPeriodToken(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func privateKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func protocolKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func publicKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func rawStringDelimiter(String, leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func regexLiteral(String, leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func repeatKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func rethrowsKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func returnKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func rightAngleToken(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func rightBraceToken(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func rightParenToken(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func rightSquareBracketToken(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func selfKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func semicolonToken(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func singleQuoteToken(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func spacedBinaryOperator(String, leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func staticKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func stringInterpolationAnchorToken(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func stringLiteral(String, leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func stringQuoteToken(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func stringSegment(String, leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func structKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func subscriptKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func superKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func switchKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func throwKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func throwsKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func trueKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func tryKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func typealiasKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func unknown(String, leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func unspacedBinaryOperator(String, leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func varKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func whereKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func whileKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func wildcardKeyword(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
static func yieldToken(leadingTrivia: Trivia?, trailingTrivia: Trivia?, presence: SourcePresence) -> TokenSyntax
func asProtocol(WithStatementsSyntax.Protocol) -> WithStatementsSyntax?
Return the non-type erased version of this syntax node if it conforms to WithStatementsSyntax
. Otherwise return nil
. Note that this will incur an existential conversion.
func asProtocol(ParenthesizedSyntax.Protocol) -> ParenthesizedSyntax?
Return the non-type erased version of this syntax node if it conforms to ParenthesizedSyntax
. Otherwise return nil
. Note that this will incur an existential conversion.
func asProtocol(WithCodeBlockSyntax.Protocol) -> WithCodeBlockSyntax?
Return the non-type erased version of this syntax node if it conforms to WithCodeBlockSyntax
. Otherwise return nil
. Note that this will incur an existential conversion.
func asProtocol(DeclGroupSyntax.Protocol) -> DeclGroupSyntax?
Return the non-type erased version of this syntax node if it conforms to DeclGroupSyntax
. Otherwise return nil
. Note that this will incur an existential conversion.
func asProtocol(WithTrailingCommaSyntax.Protocol) -> WithTrailingCommaSyntax?
Return the non-type erased version of this syntax node if it conforms to WithTrailingCommaSyntax
. Otherwise return nil
. Note that this will incur an existential conversion.
func asProtocol(IdentifiedDeclSyntax.Protocol) -> IdentifiedDeclSyntax?
Return the non-type erased version of this syntax node if it conforms to IdentifiedDeclSyntax
. Otherwise return nil
. Note that this will incur an existential conversion.
func asProtocol(BracedSyntax.Protocol) -> BracedSyntax?
Return the non-type erased version of this syntax node if it conforms to BracedSyntax
. Otherwise return nil
. Note that this will incur an existential conversion.
func children(viewMode: SyntaxTreeViewMode) -> SyntaxChildren
A sequence over the present
children of this node.
func classification(at: AbsolutePosition) -> SyntaxClassifiedRange?
The SyntaxClassifiedRange
for an absolute position.
func classification(at: Int) -> SyntaxClassifiedRange?
The SyntaxClassifiedRange
for a relative byte offset.
func classifications(in: ByteSourceRange) -> SyntaxClassifications
Sequence of SyntaxClassifiedRange
s contained in this syntax node within a relative range.
func debugDescription(includeChildren: Bool, includeTrivia: Bool, converter: SourceLocationConverter?, mark: SyntaxProtocol?, indentLevel: Int) -> String
Returns a summarized dump of this node.
func endLocation(converter: SourceLocationConverter, afterTrailingTrivia: Bool) -> SourceLocation
The ending location, in the provided file, of this Syntax node.
func firstToken(viewMode: SyntaxTreeViewMode) -> TokenSyntax?
Returns the first token node that is part of this syntax node.
func hash(into: inout Hasher)
Hashes the essential components of this value by feeding them into the given hasher.
func isProtocol(DeclGroupSyntax.Protocol) -> Bool
Check whether the non-type erased version of this syntax node conforms to DeclGroupSyntax
. Note that this will incur an existential conversion.
func isProtocol(WithCodeBlockSyntax.Protocol) -> Bool
Check whether the non-type erased version of this syntax node conforms to WithCodeBlockSyntax
. Note that this will incur an existential conversion.
func isProtocol(ParenthesizedSyntax.Protocol) -> Bool
Check whether the non-type erased version of this syntax node conforms to ParenthesizedSyntax
. Note that this will incur an existential conversion.
func isProtocol(BracedSyntax.Protocol) -> Bool
Check whether the non-type erased version of this syntax node conforms to BracedSyntax
. Note that this will incur an existential conversion.
func isProtocol(IdentifiedDeclSyntax.Protocol) -> Bool
Check whether the non-type erased version of this syntax node conforms to IdentifiedDeclSyntax
. Note that this will incur an existential conversion.
func isProtocol(WithTrailingCommaSyntax.Protocol) -> Bool
Check whether the non-type erased version of this syntax node conforms to WithTrailingCommaSyntax
. Note that this will incur an existential conversion.
func isProtocol(WithStatementsSyntax.Protocol) -> Bool
Check whether the non-type erased version of this syntax node conforms to WithStatementsSyntax
. Note that this will incur an existential conversion.
func lastToken(viewMode: SyntaxTreeViewMode) -> TokenSyntax?
Returns the last token node that is part of this syntax node.
func nextToken(viewMode: SyntaxTreeViewMode) -> TokenSyntax?
Recursively walks through the tree to find the next token semantically after this node.
func previousToken(viewMode: SyntaxTreeViewMode) -> TokenSyntax?
Recursively walks through the tree to find the token semantically before this node.
func sourceRange(converter: SourceLocationConverter, afterLeadingTrivia: Bool, afterTrailingTrivia: Bool) -> SourceRange
The source range, in the provided file, of this Syntax node.
func startLocation(converter: SourceLocationConverter, afterLeadingTrivia: Bool) -> SourceLocation
The starting location, in the provided file, of this Syntax node.
func tokens(viewMode: SyntaxTreeViewMode) -> TokenSequence
Sequence of tokens that are part of this Syntax node.
func withKind(TokenKind) -> TokenSyntax
Returns a new TokenSyntax with its kind replaced by the provided token kind.
func withLeadingTrivia(Trivia) -> TokenSyntax
Returns a new TokenSyntax with its leading trivia replaced by the provided trivia.
func withTrailingTrivia(Trivia) -> TokenSyntax
Returns a new TokenSyntax with its trailing trivia replaced by the provided trivia.
func withoutLeadingTrivia() -> TokenSyntax
Returns a new TokenSyntax with its leading trivia removed.
func withoutTrailingTrivia() -> TokenSyntax
Returns a new TokenSyntax with its trailing trivia removed.
func withoutTrivia() -> TokenSyntax
Returns a new TokenSyntax with all trivia removed.
func write<Target>(to: inout Target)
Prints the raw value of this node to the provided stream.
func createAttributeList() -> AttributeList
Conformance to ExpressibleAsAttributeList
func createBinaryOperatorExpr() -> BinaryOperatorExpr
Conformance to ExpressibleAsBinaryOperatorExpr
func createCodeBlock() -> CodeBlock
Conformance to ExpressibleAsCodeBlock
func createCodeBlockItem() -> CodeBlockItem
Conformance to ExpressibleAsCodeBlockItem
func createCodeBlockItemList() -> CodeBlockItemList
Conformance to ExpressibleAsCodeBlockItemList
func createConditionElement() -> ConditionElement
Conformance to ExpressibleAsConditionElement
func createConditionElementList() -> ConditionElementList
Conformance to ExpressibleAsConditionElementList
func createDeclModifier() -> DeclModifier
Conformance to ExpressibleAsDeclModifier
func createExprBuildable() -> ExprBuildable
func createExprList() -> ExprList
Conformance to ExpressibleAsExprList
func createGarbageNodes() -> GarbageNodes
Conformance to ExpressibleAsGarbageNodes
func createIdentifierExpr() -> IdentifierExpr
Conformance to ExpressibleAsIdentifierExpr
func createInitializerClause() -> InitializerClause
Conformance to ExpressibleAsInitializerClause
func createModifierList() -> ModifierList
Conformance to ExpressibleAsModifierList
func createNonEmptyTokenList() -> NonEmptyTokenList
Conformance to ExpressibleAsNonEmptyTokenList
func createPrecedenceGroupAttributeList() -> PrecedenceGroupAttributeList
Conformance to ExpressibleAsPrecedenceGroupAttributeList
func createSpecializeAttributeSpecList() -> SpecializeAttributeSpecList
Conformance to ExpressibleAsSpecializeAttributeSpecList
func createStringLiteralSegments() -> StringLiteralSegments
Conformance to ExpressibleAsStringLiteralSegments
func createSwitchCaseList() -> SwitchCaseList
Conformance to ExpressibleAsSwitchCaseList
func createSyntaxBuildable() -> SyntaxBuildable
func createTokenList() -> TokenList
Conformance to ExpressibleAsTokenList
static func != (Self, Self) -> Bool
static func == (Self, Self) -> Bool
Returns a Boolean value indicating whether two values are equal.
var children: SyntaxChildren
var tokens: TokenSequence
Sequence of tokens that are part of this Syntax node.