First error message!

This commit is contained in:
VegOwOtenks 2024-10-08 12:34:37 +02:00
parent af2574b769
commit 8ab0282199

View file

@ -1,5 +1,6 @@
#include "interpreter.h" #include "interpreter.h"
#include <stdio.h>
#include <stdalign.h> #include <stdalign.h>
static int CallFrame_Create(CallFrame* self, FlupFunction* self_function) static int CallFrame_Create(CallFrame* self, FlupFunction* self_function)
@ -499,14 +500,20 @@ int Interpreter_ExecuteNext(Interpreter* self, size_t stop_token)
case TOKENTYPE_GREATERTHAN: case TOKENTYPE_GREATERTHAN:
case TOKENTYPE_GREATEREQUAL: case TOKENTYPE_GREATEREQUAL:
case TOKENTYPE_COMMA: case TOKENTYPE_COMMA:
case TOKENTYPE_BIND:
case TOKENTYPE_AS:
case TOKENTYPE_LEFT_PAREN:
case TOKENTYPE_RIGHT_PAREN:
fprintf(stderr, "Unexpected token with type: %s\n, continuing with next token...\n", TokenType_ToString(t->type));
top_frame->instruction_pointer++;
break; break;
case TOKENTYPE_NONE: case TOKENTYPE_NONE:
case TOKENTYPE_ERROR: case TOKENTYPE_ERROR:
return EXIT_FAILURE; return EXIT_FAILURE;
} }
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
bool Value_IsTruthy(Value* v) bool Value_IsTruthy(Value* v)