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:
Ronan Cherrueau ⚓ 2020-04-03 20:35:31 +02:00 committed by GitHub
parent 35f82ce301
commit b65582797a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);