Implement String structure and update Location/Token to use it

This commit is contained in:
2026-04-25 14:17:17 +02:00
parent 902e2f0325
commit 116bdecafe
9 changed files with 73 additions and 35 deletions
+8 -6
View File
@@ -4,6 +4,8 @@
#ifndef LOCATION_H
#define LOCATION_H
#include "string.h"
#include <stddef.h>
typedef struct {
@@ -11,16 +13,16 @@ typedef struct {
char* filename;
/// @brief The entire line of text where the token was found.
char* line_text;
/// @brief The length of the `line_text` string.
size_t line_text_length;
String line_text;
/// @brief The line number where the token was found.
int line;
/// @brief The column number where the token was found.
int column;
/// @brief The starting column number where the token was found.
int column_start;
/// @brief The ending column number where the token was found.
int column_end;
} Location;
#endif