klyn.code.LexicalState.LexicalState
constructor
public LexicalState(
mode as LexicalMode = LexicalMode.NORMAL,
delimiter as String = "",
isRaw as Boolean = false,
isFormatted as Boolean = false,
interpolationDepth as Int = 0,
queryIndent as Int = -1,
fenceLanguage as String = ""
)
Description

Constructs a lexical state with explicit continuation parameters.

Parameters
ParameterDescription
modeActive multi-line lexical mode.
delimiterExpected closing delimiter (such as "-->" or "\"\"\"").
isRawtrue when inside a raw string literal where \ does not escape.
isFormattedtrue when inside an interpolated string (f"..." or template literal).
interpolationDepthCurrent {...} nesting depth inside an interpolated string.
queryIndentIndentation column of an active Klyn query: block, or -1 when inactive.
fenceLanguageEmbedded language identifier inside a Markdown code fence.
Example
import klyn.code

commentState = LexicalState(LexicalMode.MARKUP_COMMENT, "-->")
assert commentState.inBlockComment()