public nextLineState(line as String, initialState as LexicalState = null) as LexicalState
Fast state-only line transition that computes the resulting LexicalState without allocating TokenSpan objects.
| Parameter | Description |
|---|---|
line | Source line text. |
initialState | Lexical state at the start of line, or null for LexicalState.NORMAL. |
End-of-line LexicalState.
import klyn.code
p = LanguageProfile("xml", "XML").withBlockComment("<!--", "-->")
t = CodeTokenizer(p)
state = t.nextLineState("<!-- multi-line start", LexicalState.NORMAL)
assert state.inBlockComment()