implementation of useful error messages

This commit is contained in:
vegowotenks 2024-10-10 18:59:17 +02:00
parent 2ce8200366
commit c12e763b28
14 changed files with 295 additions and 68 deletions

View file

@ -43,15 +43,21 @@ union TokenContent {
double decimal;
};
typedef struct TokenContext_s {
uint32_t row;
uint32_t col;
} TokenContext;
typedef struct Token_s {
enum TokenType type;
union TokenContent get;
TokenContext context;
} Token;
#define TOKEN_NONE ((Token) {.type = TOKENTYPE_NONE, .get = {.error = STRINGVIEW_NONE } } )
Token Tokenizer_NextToken(StringView* source);
Token Tokenizer_NextToken(StringView* source, TokenContext* context);
const char* TokenType_ToString(enum TokenType type);
#endif //header guard