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 = "" )
Constructs a lexical state with explicit continuation parameters.
| Parameter | Description |
|---|---|
mode | Active multi-line lexical mode. |
delimiter | Expected closing delimiter (such as "-->" or "\"\"\""). |
isRaw | true when inside a raw string literal where \ does not escape. |
isFormatted | true when inside an interpolated string (f"..." or template literal). |
interpolationDepth | Current {...} nesting depth inside an interpolated string. |
queryIndent | Indentation column of an active Klyn query: block, or -1 when inactive. |
fenceLanguage | Embedded language identifier inside a Markdown code fence. |
import klyn.code commentState = LexicalState(LexicalMode.MARKUP_COMMENT, "-->") assert commentState.inBlockComment()