SwiftLintSyntaxMap

public struct SwiftLintSyntaxMap

Represents a Swift file’s syntax information.

  • The raw SyntaxMap obtained by SourceKitten.

    Declaration

    Swift

    public let value: SyntaxMap
  • The SwiftLint-specific syntax tokens for this syntax map.

    Declaration

    Swift

    public let tokens: [SwiftLintSyntaxToken]
  • Creates a SwiftLintSyntaxMap from the raw SyntaxMap obtained by SourceKitten.

    Declaration

    Swift

    public init(value: SyntaxMap)

    Parameters

    value

    The raw SyntaxMap obtained by SourceKitten.

  • Returns array of syntax tokens intersecting with byte range.

    Declaration

    Swift

    public func tokens(inByteRange byteRange: ByteRange) -> [SwiftLintSyntaxToken]

    Parameters

    byteRange

    Byte-based NSRange.

    Return Value

    The array of syntax tokens intersecting with byte range.

  • Returns the syntax kinds in the specified byte range.

    Declaration

    Swift

    public func kinds(inByteRange byteRange: ByteRange) -> [SyntaxKind]

    Parameters

    byteRange

    Byte range.

    Return Value

    The syntax kinds in the specified byte range.