This repository has been archived on 2026-03-01. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
v2/src/parser/parser.c

20 lines
556 B
C
Raw Normal View History

2026-02-22 09:21:51 +11:00
#include "parser.h"
2026-02-22 12:40:47 +11:00
#include "SolsNode.h"
#include "../include/estr.h"
2026-02-22 09:21:51 +11:00
ResultType(SolsParser, charptr) createSolsParser(SolsTokens* input) {
2026-02-22 12:40:47 +11:00
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);
2026-02-22 09:21:51 +11:00
}