Remove unneeded parameters from public interface of stack_iterate callback

This commit is contained in:
Max Brunsfeld 2017-06-29 16:43:56 -07:00
parent 009d6d1534
commit a89322c5f1
4 changed files with 52 additions and 54 deletions

View file

@ -12,8 +12,7 @@ extern "C" {
typedef struct Stack Stack;
typedef unsigned int StackVersion;
typedef unsigned StackVersion;
#define STACK_VERSION_NONE ((StackVersion)-1)
typedef struct {
@ -28,19 +27,16 @@ typedef struct {
StackSliceArray slices;
} StackPopResult;
typedef unsigned StackIterateAction;
enum {
StackIterateNone,
StackIterateStop = 1 << 0,
StackIteratePop = 1 << 1,
StackIterateStop = 1,
StackIteratePop = 2,
};
typedef unsigned int StackIterateAction;
typedef StackIterateAction (*StackIterateCallback)(void *, TSStateId state,
TreeArray *trees,
uint32_t tree_count,
bool is_done,
bool is_pending);
const TreeArray *trees,
uint32_t tree_count);
/*
* Create a parse stack.
@ -91,8 +87,7 @@ void ts_stack_push(Stack *, StackVersion, Tree *, bool, TSStateId);
*/
StackPopResult ts_stack_pop_count(Stack *, StackVersion, uint32_t count);
StackPopResult ts_stack_iterate(Stack *, StackVersion, StackIterateCallback,
void *);
StackPopResult ts_stack_iterate(Stack *, StackVersion, StackIterateCallback, void *);
StackPopResult ts_stack_pop_pending(Stack *, StackVersion);