Skip to content

Commit d4d7b08

Browse files
committed
TokenSyntax.rawTokenKind to get raw token kind
`TokenSyntax.tokenKind` instantiate `TokenKind` with `Swift.String`. Getting `RawTokenKind` is useful for performance critical logic.
1 parent 62d8f9f commit d4d7b08

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Sources/SwiftSyntax/TokenSyntax.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ public struct TokenSyntax: SyntaxProtocol, SyntaxHashable {
115115
}
116116
}
117117

118+
@_spi(RawSyntax)
119+
public var rawTokenKind: RawTokenKind {
120+
return tokenView.rawKind
121+
}
122+
118123
/// The length this node takes up spelled out in the source, excluding its
119124
/// leading or trailing trivia.
120125
public var trimmedLength: SourceLength {

0 commit comments

Comments
 (0)