Replace p_context_init() with p_context_new()/p_context_delete()

This commit is contained in:
josh committed 2026-02-17 18:40:33 -05:00
1 parent 9f2fe6f84b
commit 6fd5186159
77 files changed
+728 -610

No files matched your search

+7 -7
View File
@@ -10,10 +10,10 @@ int main()
unittest
{
string input = "abbccc";
p_context_t context;
p_context_init(&context, input);
assert(p_parse(&context) == P_SUCCESS);
Start * start = p_result(&context);
p_context_t * context;
context = p_context_new(input);
assert(p_parse(context) == P_SUCCESS);
Start * start = p_result(context);
assert_eq(1, start.pT1.pToken.position.row);
assert_eq(1, start.pT1.pToken.position.col);
@@ -48,9 +48,9 @@ unittest
assert_eq(6, start.end_position.col);
input = "\n\n bb\nc\ncc\n\n a";
p_context_init(&context, input);
assert(p_parse(&context) == P_SUCCESS);
start = p_result(&context);
context = p_context_new(input);
assert(p_parse(context) == P_SUCCESS);
start = p_result(context);
assert_eq(3, start.pT1.pToken.position.row);
assert_eq(3, start.pT1.pToken.position.col);