Store AST nodes' non-hidden children
This commit is contained in:
parent
95188d84b6
commit
3a7c4bb5b1
6 changed files with 77 additions and 57 deletions
|
|
@ -21,12 +21,12 @@ describe("tracking the positions of AST nodes", []() {
|
|||
const ts_tree *tree = ts_document_tree(doc);
|
||||
|
||||
const ts_tree *array = ts_tree_children(tree, NULL)[0];
|
||||
const ts_tree *number1 = ts_tree_children(ts_tree_children(array, NULL)[1], NULL)[0];
|
||||
const ts_tree *number2 = ts_tree_children(ts_tree_children(ts_tree_children(array, NULL)[2], NULL)[1], NULL)[0];
|
||||
const ts_tree *number1 = ts_tree_children(array, NULL)[0];
|
||||
const ts_tree *number2 = ts_tree_children(array, NULL)[1];
|
||||
|
||||
AssertThat(ts_document_symbol_name(doc, array), Equals("array"));
|
||||
AssertThat(ts_document_symbol_name(doc, number1), Equals("number"));
|
||||
AssertThat(ts_document_symbol_name(doc, number2), Equals("number"));
|
||||
AssertThat(ts_document_symbol_name(doc, number1), Equals("value"));
|
||||
AssertThat(ts_document_symbol_name(doc, number2), Equals("value"));
|
||||
|
||||
AssertThat(ts_tree_offset(number1), Equals<size_t>(0));
|
||||
AssertThat(ts_tree_size(number1), Equals<size_t>(2));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue