Use this function with ts::ts_tree_new() to create a tree-sitter
tree for a JSONC document.
The JSON grammar
The grammar has the following node types. I included some less important nodes in the subsection of other nodes that they are related to.
Comments may appear between any tokens, but they are not part of the grammar.
Use the bracket operator,
ts::ts_tree_dom() and ts::ts_tree_ast() to explore the parse tree
of a JSON document.
object / pair
An object is a sequence of
{,zero or more
pairnodes, separated by,nodes, trailing commas are allowed,}.
A pair is a series of
a key, a
stringnode,:,a value (see above).
array
An array is a sequence of
[,zero or more values (see above), separated by
,nodes, trailing commas are allowed,].
number
An integer or floating point number. Minus sign is part of the number. Scientific notation is supported.