implemented nullable type notation

This commit is contained in:
cozis
2022-12-04 18:39:42 +01:00
parent d610a973f4
commit 7a07a1eb3c
12 changed files with 156 additions and 9 deletions
+5 -1
View File
@@ -174,6 +174,7 @@ static Opcode exprkind_to_opcode(ExprKind kind)
{
switch(kind)
{
case EXPR_NULLABLETYPE: return OPCODE_NLB;
case EXPR_NOT: return OPCODE_NOT;
case EXPR_POS: return OPCODE_POS;
case EXPR_NEG: return OPCODE_NEG;
@@ -475,10 +476,13 @@ static void emitInstrForExprNode(CodegenContext *ctx, ExprNode *expr,
switch(expr->kind)
{
case EXPR_PAIR:
CodegenContext_ReportErrorAndJump(ctx, 0, "Tuple outside of assignment or return statement");
CodegenContext_ReportErrorAndJump(
ctx, 0, "Tuple outside of "
"assignment or return statement");
UNREACHABLE;
return; // For the compiler warning.
case EXPR_NULLABLETYPE:
case EXPR_NOT:
case EXPR_POS: case EXPR_NEG:
case EXPR_ADD: case EXPR_SUB: