aboutsummaryrefslogtreecommitdiff
path: root/src/compiler/lexer.c
diff options
context:
space:
mode:
authorA404M <ahmadmahmoudiprogrammer@gmail.com>2025-05-16 01:20:33 +0330
committerA404M <ahmadmahmoudiprogrammer@gmail.com>2025-05-16 01:20:33 +0330
commit42eb5e5d3f10c3a9187dcf8edd7c023a3ea10dcd (patch)
tree78862ab27c3b1faf2d9ed5722bceb0264602bd1a /src/compiler/lexer.c
parent0b8d272292ca3f7fdb44efac65f012b484d962a2 (diff)
fix access operator and some stuff to make break work
Diffstat (limited to 'src/compiler/lexer.c')
-rw-r--r--src/compiler/lexer.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/compiler/lexer.c b/src/compiler/lexer.c
index c540395..517e650 100644
--- a/src/compiler/lexer.c
+++ b/src/compiler/lexer.c
@@ -99,6 +99,7 @@ const char *LEXER_TOKEN_STRINGS[] = {
"LEXER_TOKEN_KEYWORD_RETURN",
"LEXER_TOKEN_KEYWORD_PUTC",
+ "LEXER_TOKEN_KEYWORD_BREAK",
"LEXER_TOKEN_KEYWORD_COMPTIME",
"LEXER_TOKEN_SYMBOL_EOL",
@@ -170,7 +171,7 @@ static const char *LEXER_KEYWORD_STRINGS[] = {
"f32", "f64", "f128", "bool", "putc", "return",
"true", "false", "if", "else", "while", "comptime",
"null", "struct", "undefined", "code", "lazy", "namespace",
- "shape_shifter",
+ "shape_shifter", "break",
};
static const LexerToken LEXER_KEYWORD_TOKENS[] = {
LEXER_TOKEN_KEYWORD_TYPE,
@@ -205,6 +206,7 @@ static const LexerToken LEXER_KEYWORD_TOKENS[] = {
LEXER_TOKEN_KEYWORD_LAZY,
LEXER_TOKEN_KEYWORD_NAMESPACE,
LEXER_TOKEN_KEYWORD_SHAPE_SHIFTER,
+ LEXER_TOKEN_KEYWORD_BREAK,
};
static const size_t LEXER_KEYWORD_SIZE =
sizeof(LEXER_KEYWORD_TOKENS) / sizeof(*LEXER_KEYWORD_TOKENS);
@@ -518,6 +520,8 @@ lexerPushClear(LexerNodeArray *array, size_t *array_size, char const *iter,
case LEXER_TOKEN_BUILTIN_SMALLER_OR_EQUAL:
case LEXER_TOKEN_SYMBOL_CLOSE_BRACKET:
case LEXER_TOKEN_SYMBOL_OPEN_BRACKET:
+ case LEXER_TOKEN_KEYWORD_SHAPE_SHIFTER:
+ case LEXER_TOKEN_KEYWORD_BREAK:
if (*array_size == array->size) {
*array_size += 1 + *array_size / 2;
array->data =