Documentation
¶
Overview ¶
Package jsonnode builds the yaml.Node tree for a JSON document directly, without running yaml's scanner.
yaml parses JSON as a flow collection, and its scanner treats the opening '{' as a potential simple key, so it buffers every token of the document until the closing '}'. For a large JSON specification that is hundreds of megabytes of token queue. JSON's grammar is small enough to parse directly into the exact tree yaml would produce: the same kinds, tags, styles, values, lines and columns.
Parse only accepts input whose yaml parse it reproduces exactly. Anything else (invalid JSON, or valid JSON that yaml reads differently, such as a key separated from its colon by a line break) is declined, and the caller parses it with yaml instead, getting yaml's result or yaml's error.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.