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

+9 -2
View File
@@ -10,8 +10,7 @@ int main()
unittest
{
string input = "\na\n bb ccc";
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);
@@ -34,6 +33,8 @@ unittest
assert_eq(3, start.end_position.row);
assert_eq(8, start.end_position.col);
p_tree_delete(start);
input = "a\nbb";
context = p_context_new(input);
assert(p_parse(context) == P_SUCCESS);
@@ -58,6 +59,8 @@ unittest
assert_eq(2, start.end_position.row);
assert_eq(2, start.end_position.col);
p_tree_delete(start);
input = "a\nc\nc";
context = p_context_new(input);
assert(p_parse(context) == P_SUCCESS);
@@ -82,6 +85,8 @@ unittest
assert_eq(3, start.end_position.row);
assert_eq(1, start.end_position.col);
p_tree_delete(start);
input = "a";
context = p_context_new(input);
assert(p_parse(context) == P_SUCCESS);
@@ -101,4 +106,6 @@ unittest
assert_eq(1, start.position.col);
assert_eq(1, start.end_position.row);
assert_eq(1, start.end_position.col);
p_tree_delete(start);
}