Fixed a bug where the tokenizer wasn't parsing hexadecimal numbers correctly. Added support for tokenizing the colon and comma characters.

This commit is contained in:
2025-01-08 23:22:43 -06:00
parent 428d674f54
commit ebfd7cf94c
6 changed files with 86 additions and 21 deletions
+4 -1
View File
@@ -1,6 +1,8 @@
#ifndef ARRAY_H
#define ARRAY_H
#include <stdbool.h>
typedef struct _array {
int Capacity;
int Size;
@@ -8,6 +10,7 @@ typedef struct _array {
} Array;
Array* ArrayCreate(void);
int ArrayAdd(Array* array, void* item);
bool ArrayAdd(Array* array, void* item);
void* ArrayPeek(Array* array);
#endif
+3 -1
View File
@@ -12,6 +12,8 @@ typedef enum {
Number,
Symbol,
LineEnd = '\n',
Colon = ':',
Comma = ',',
Plus = '+',
Minus = '-',
Star = '*',
@@ -37,7 +39,7 @@ typedef struct _token {
} Token;
Token* TokenCreate(TokenType type, int lineNumber, int columnNumber, bool resolved);
char* TokenStringify(const Token* token, bool valueOnly);
char* TokenStringify(const Token* token);
int StringifyTokenType(TokenType type, char buffer[32]);
#endif