From d6a942367e7825744e32c6e42b950ce406fa4ad4 Mon Sep 17 00:00:00 2001 From: Maxwell Jeffress Date: Sun, 22 Feb 2026 12:40:47 +1100 Subject: [PATCH] createSolsParser function --- src/parser/parser.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/parser/parser.c b/src/parser/parser.c index 74740c1..deacd31 100644 --- a/src/parser/parser.c +++ b/src/parser/parser.c @@ -1,5 +1,19 @@ #include "parser.h" +#include "SolsNode.h" + +#include "../include/estr.h" ResultType(SolsParser, charptr) createSolsParser(SolsTokens* input) { - return Error(SolsParser, charptr, "Work in progress"); + ResultType(SolsNode, charptr) node = createSolsNode(SNT_ROOT); + if (node.error) { + Estr str = CREATE_ESTR(node.as.error); + APPEND_ESTR(str, " (in createSolsParser() function)"); + } + SolsParser parser = { + .input = input, + .current = 0, + .output = node.as.success + }; + parser.currentParent = &parser.output; + return Success(SolsParser, charptr, parser); }