Skip to main content

Module json

Module json 

Source
Expand description

Fast line-oriented JSON tokenization.

The TextMate JSON grammar is expensive for large blobs because it drives a recursive regex stack. This module keeps JSON highlighting bounded and allocation-light by scanning one line at a time.

Constants§

CONSTANT
Scope id for JSON constants such as true, false, and null.
NUMBER
Scope id for JSON numbers.
PROPERTY_NAME
Scope id for JSON property names.
SCOPES
Scope names emitted by tokenize_line_into.
STRING
Scope id for JSON string content.
STRING_PUNCTUATION
Scope id for JSON string delimiters.

Functions§

tokenize_line_into
Tokenizes one JSON line into caller-owned storage.