Explicitly inform stack pop callback when the stack is exhausted

Also, pass non-extra tree count as a single value, rather than keeping
track of the extra count and the total separately.
This commit is contained in:
Max Brunsfeld 2016-03-10 11:51:38 -08:00
parent 288a164823
commit e7d3d40a59
4 changed files with 25 additions and 24 deletions

View file

@ -40,8 +40,8 @@ typedef enum {
} StackIterateAction;
typedef StackIterateAction (*StackIterateCallback)(void *, TSStateId state,
size_t depth,
size_t extra_count);
size_t tree_count,
bool is_done);
typedef int (*TreeSelectionFunction)(void *, TSTree *tree1, TSTree *tree2);