Add p_context_delete() and p_tree_delete() for D targets

This commit is contained in:
josh committed 2026-02-28 21:12:35 -05:00
1 parent d440d0442d
commit dd687d0299
11 files changed
+105 -24

No files matched your search

@@ -10,8 +10,7 @@ int main()
unittest
{
string input = "b";
p_context_t * context;
context = p_context_new(input);
p_context_t * context = p_context_new(input);
assert(p_parse(context) == P_SUCCESS);
Start * start = p_result(context);
assert(start.pToken1 is null);
@@ -21,6 +20,8 @@ unittest
assert(start.pR is null);
assert(start.r is null);
p_tree_delete(start);
input = "abcd";
context = p_context_new(input);
assert(p_parse(context) == P_SUCCESS);
@@ -35,6 +36,8 @@ unittest
assert(start.pR == start.r);
assert_eq(TOKEN_c, start.pR.pToken1.token);
p_tree_delete(start);
input = "bdc";
context = p_context_new(input);
assert(p_parse(context) == P_SUCCESS);
@@ -43,4 +46,6 @@ unittest
assert(start.pToken2 !is null);
assert(start.pR !is null);
assert_eq(TOKEN_d, start.pR.pToken1.token);
p_tree_delete(start);
}