Package-level declarations

Types

Link copied to clipboard
external interface CommentRange : TextRange
Link copied to clipboard
external interface DiagnosticMessage
Link copied to clipboard
typealias ErrorCallback = (message: DiagnosticMessage, length: Int, arg0: Any?) -> Unit
Link copied to clipboard
external interface Scanner

Functions

Link copied to clipboard
external fun couldStartTrivia(text: String, pos: Int): Boolean
Link copied to clipboard
external fun createScanner(languageVersion: ScriptTarget, skipTrivia: Boolean, languageVariant: LanguageVariant = definedExternally, textInitial: String = definedExternally, onError: ErrorCallback = definedExternally, start: Int = definedExternally, length: Int = definedExternally): Scanner
Link copied to clipboard
external fun <U> forEachLeadingCommentRange(text: String, pos: Int, cb: (pos: Int, end: Int, kind: CommentKind, hasTrailingNewLine: Boolean) -> U): U?
external fun <T, U> forEachLeadingCommentRange(text: String, pos: Int, cb: (pos: Int, end: Int, kind: CommentKind, hasTrailingNewLine: Boolean, state: T) -> U, state: T): U?
Link copied to clipboard
external fun <U> forEachTrailingCommentRange(text: String, pos: Int, cb: (pos: Int, end: Int, kind: CommentKind, hasTrailingNewLine: Boolean) -> U): U?
external fun <T, U> forEachTrailingCommentRange(text: String, pos: Int, cb: (pos: Int, end: Int, kind: CommentKind, hasTrailingNewLine: Boolean, state: T) -> U, state: T): U?
Link copied to clipboard
Link copied to clipboard
external fun getShebang(text: String): String?

Optionally, get the shebang

Link copied to clipboard
Link copied to clipboard
external fun isIdentifierPart(ch: Int, languageVersion: ScriptTarget?, identifierVariant: LanguageVariant = definedExternally): Boolean
Link copied to clipboard
external fun isIdentifierStart(ch: Int, languageVersion: ScriptTarget?): Boolean
Link copied to clipboard
external fun isLineBreak(ch: Int): Boolean
Link copied to clipboard
external fun isWhiteSpaceLike(ch: Int): Boolean
Link copied to clipboard

Does not include line breaks. For that, see isWhiteSpaceLike.

Link copied to clipboard
external fun <T, U> reduceEachLeadingCommentRange(text: String, pos: Int, cb: (pos: Int, end: Int, kind: CommentKind, hasTrailingNewLine: Boolean, state: T) -> U, state: T, initial: U): U?
Link copied to clipboard
external fun <T, U> reduceEachTrailingCommentRange(text: String, pos: Int, cb: (pos: Int, end: Int, kind: CommentKind, hasTrailingNewLine: Boolean, state: T) -> U, state: T, initial: U): U?
Link copied to clipboard
external fun tokenToString(t: SyntaxKind): String?