From 855d68300599b7b631338094fb1ea4d95b7c0423 Mon Sep 17 00:00:00 2001 From: laentropia Date: Fri, 24 Apr 2026 07:02:00 -0600 Subject: [PATCH] addition: Resul structs for rework --- include/lexer.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/include/lexer.h b/include/lexer.h index f4b7d81..3995b2e 100644 --- a/include/lexer.h +++ b/include/lexer.h @@ -53,6 +53,29 @@ typedef struct ASTNode { } data; } ASTNode; +typedef struct { + bool is_valid; + union { + LexerErr err; + ArrayList *arr; + }; +} TokenizeResult; + +typedef struct { + bool is_valid; + union { + LexerErr err; + ASTNode node; + }; +} ASTNodeResult; + +typedef struct { + bool is_valid; + union { + LexerErr err; + int64_t number; + }; +} I64Result; // I prefer ot have a dynamic array for storing the "tokens" typedef struct { size_t len;