public override tokenizeLine(line as String, initialState as LexicalState = null) as LineScanResult
Tokenizes a single line of JSON/JSONC, promoting "key" tokens immediately followed by : to TokenKind.PROPERTY_NAME.
| Parameter | Description |
|---|---|
line | Single line of JSON text. |
initialState | Lexical state inherited from the previous line. |
LineScanResult with JSON token spans.
import klyn.code
import klyn.code.json
t = JsonTokenizer()
res = t.tokenizeLine(" \"version\": 1")
assert res.spans[1].kind == TokenKind.PROPERTY_NAME