Rework tree generation mode and API
Store tree nodes in congruent, compact arena array. Define handle types to refer to tree nodes rather than pointers to structure instances. Free tree with context.
This commit is contained in:
1 parent
dddb1b5089
commit
5fc712c6ee
39 files changed
+1349
-811
No files matched your search
@@ -9,11 +9,10 @@ int main()
|
||||
p_context_t * context;
|
||||
context = p_context_new((uint8_t const *)input, strlen(input));
|
||||
assert_eq(P_SUCCESS, p_parse(context));
|
||||
Top * top = p_result(context);
|
||||
assert(top->pToken != NULL);
|
||||
assert_eq(TOKEN_hi, top->pToken->token);
|
||||
Top top = p_result(context);
|
||||
assert(p_node_valid(p_Top_pToken(top)));
|
||||
assert_eq(TOKEN_hi, p_tree_walk_Top(top, pToken, token));
|
||||
|
||||
p_tree_delete(top);
|
||||
p_context_delete(context);
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in new issue
Block a user