klyn.code.CodeTokenizer.nextLineState
method
public nextLineState(line as String, initialState as LexicalState = null) as LexicalState
Description

Fast state-only line transition that computes the resulting LexicalState without allocating TokenSpan objects.

Parameters
ParameterDescription
lineSource line text.
initialStateLexical state at the start of line, or null for LexicalState.NORMAL.
Returns

End-of-line LexicalState.

Example
import klyn.code

p = LanguageProfile("xml", "XML").withBlockComment("<!--", "-->")
t = CodeTokenizer(p)
state = t.nextLineState("<!-- multi-line start", LexicalState.NORMAL)
assert state.inBlockComment()