Allowed for empty arrays and trailing commas

This commit is contained in:
2024-12-10 10:44:13 +11:00
parent 1a36c14247
commit 5f75b5f1a3
4 changed files with 49 additions and 4 deletions

View File

@@ -715,11 +715,11 @@ static unsigned int writeRoutineCode(Toy_Routine** rt, Toy_Ast* ast) {
result += writeInstructionAccess(rt, ast->varAccess);
break;
//meta instructions are disallowed
case TOY_AST_PASS:
//NOTE: this *should* be disallowed, but for now it's required for testing
//NO-OP
break;
//meta instructions are disallowed
case TOY_AST_ERROR:
fprintf(stderr, TOY_CC_ERROR "COMPILER ERROR: Invalid AST type found: Unknown 'error'\n" TOY_CC_RESET);
(*rt)->panic = true;