Start work on =

This commit is contained in:
2026-02-24 21:22:50 +11:00
parent 48206c2f50
commit cd204b7bc1
2 changed files with 71 additions and 5 deletions

View File

@@ -33,6 +33,14 @@ static inline ResultType(GroundProgram, charptr) generatePutsNode(SolsNode* node
return Success(GroundProgram, charptr, program);
}
static inline ResultType(GroundProgram, charptr) generateSetNode(SolsNode* node, SolsScope* scope) {
if (node->children.count <= 2) {
return Error(GroundProgram, charptr, "set requires arguments");
}
return Error(GroundProgram, charptr, "WIP");
addVariableToScope(scope, node->children.at[0].as.idName, NULL);
}
ResultType(GroundProgram, charptr) generateCode(SolsNode* node, SolsScope* scope) {
GroundProgram program = groundCreateProgram();
@@ -52,6 +60,7 @@ ResultType(GroundProgram, charptr) generateCode(SolsNode* node, SolsScope* scope
switch (node->type) {
case SNT_PUTS: generate(Puts);
case SNT_LITERAL: generate(Literal);
case SNT_OP_SET: generate(Set);
}
return Success(GroundProgram, charptr, program);
}