Functions are WIP, read more

They're no-ops in compilation for now, and param types aren't parsed.

'return' keyword needs to be implemented.

Was distracted by bugfixes in v2 and v2-docs.
This commit is contained in:
2025-02-02 17:26:47 +11:00
parent 336616a1bf
commit b93ea5006c
6 changed files with 76 additions and 9 deletions

View File

@@ -899,10 +899,11 @@ static unsigned int writeInstructionAccess(Toy_ModuleBuilder** mb, Toy_AstVarAcc
return 1;
}
//routine structure
// static void writeModuleBuilderParam(Toy_ModuleBuilder* mb) {
// //
// }
static unsigned int writeInstructionFnDeclare(Toy_ModuleBuilder** mb, Toy_AstFnDeclare ast) {
(void)mb;
(void)ast;
return 0;
}
static unsigned int writeModuleBuilderCode(Toy_ModuleBuilder** mb, Toy_Ast* ast) {
if (ast == NULL) {
@@ -1010,6 +1011,10 @@ static unsigned int writeModuleBuilderCode(Toy_ModuleBuilder** mb, Toy_Ast* ast)
result += writeInstructionAccess(mb, ast->varAccess);
break;
case TOY_AST_FN_DECLARE:
result += writeInstructionFnDeclare(mb, ast->fnDeclare);
break;
case TOY_AST_PASS:
//NO-OP
break;