Implement String structure and update Location/Token to use it
This commit is contained in:
+8
-6
@@ -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
|
||||
Reference in New Issue
Block a user