mirror of
https://github.com/tree-sitter/tree-sitter.git
synced 2026-09-10 07:26:23 -04:00
Fix the Getting Started example in docs (#588)
Running the first example of the Getting Started failed with: main: Assertion `strcmp(ts_node_type(root_node), "value") == 0' failed. The cause is the json parser that renamed the entry rule from `value` to `document` in commit tree-sitter/tree-sitter-json@1e4abcc. This commit update the example in docs to fix the assert.
This commit is contained in:
parent
35f82ce301
commit
b65582797a
|
|
@ -78,7 +78,7 @@ int main() {
|
|||
TSNode number_node = ts_node_named_child(array_node, 0);
|
||||
|
||||
// Check that the nodes have the expected types.
|
||||
assert(strcmp(ts_node_type(root_node), "value") == 0);
|
||||
assert(strcmp(ts_node_type(root_node), "document") == 0);
|
||||
assert(strcmp(ts_node_type(array_node), "array") == 0);
|
||||
assert(strcmp(ts_node_type(number_node), "number") == 0);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue