summaryrefslogtreecommitdiff
path: root/src/lexer.h
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2025-10-06 05:06:16 -0400
committerLLLL Colonq <llll@colonq>2025-10-06 05:06:41 -0400
commit09435bffe025a96e0d9c3b44ee9c505973b383bd (patch)
treed352772edc096a374d42c50ffa4a7b2b8dad59dd /src/lexer.h
parent063ab38ce78c370c698e5d148bb9f993ee731ddb (diff)
Cleanup, fix bugs
Ensure everything builds on C89
Diffstat (limited to 'src/lexer.h')
-rw-r--r--src/lexer.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lexer.h b/src/lexer.h
index 6f48d8f..19f8d71 100644
--- a/src/lexer.h
+++ b/src/lexer.h
@@ -13,18 +13,19 @@ typedef enum {
PIT_LEX_TOKEN_INTEGER_LITERAL,
PIT_LEX_TOKEN_STRING_LITERAL,
PIT_LEX_TOKEN_SYMBOL,
- PIT_LEX_TOKEN__SENTINEL,
+ PIT_LEX_TOKEN__SENTINEL
} pit_lex_token;
typedef struct {
char *input;
- i64 len; // length of input
- i64 start, end; // bounds of the current token
- i64 line, column; // for error reporting only; current line and column
- i64 start_line, start_column; // for error reporting only; line and column of token start
+ i64 len; /* length of input */
+ i64 start, end; /* bounds of the current token */
+ i64 line, column; /* for error reporting only; current line and column */
+ i64 start_line, start_column; /* for error reporting only; line and column of token start */
char *error;
} pit_lexer;
+void pit_lex_cstr(pit_lexer *ret, char *buf);
void pit_lex_bytes(pit_lexer *ret, char *buf, i64 len);
void pit_lex_file(pit_lexer *ret, char *path);
pit_lex_token pit_lex_next(pit_lexer *st);