aboutsummaryrefslogtreecommitdiff
path: root/src/compiler/lexer/lexer.h
diff options
context:
space:
mode:
authorA404M <ahmadmahmoudiprogrammer@gmail.com>2024-09-22 19:34:43 +0330
committerA404M <ahmadmahmoudiprogrammer@gmail.com>2024-09-22 19:34:43 +0330
commitf79290084948f3cf140395c270c07cf29ca58e8d (patch)
treed716526678782153f3617bbf78984b4c4ebed380 /src/compiler/lexer/lexer.h
parentd2ab53c625d386a4fbc6a9d5a5eb29faab1b3f0c (diff)
Better errors
Added variables
Diffstat (limited to 'src/compiler/lexer/lexer.h')
-rw-r--r--src/compiler/lexer/lexer.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/compiler/lexer/lexer.h b/src/compiler/lexer/lexer.h
index 802b50c..8d88a90 100644
--- a/src/compiler/lexer/lexer.h
+++ b/src/compiler/lexer/lexer.h
@@ -1,5 +1,6 @@
#pragma once
+#include <compiler/error_helper/error_helper.h>
#include <stddef.h>
#include <utils/memory/memory.h>
#include <utils/types.h>
@@ -17,18 +18,25 @@ typedef enum Token {
TOKEN_OPERATOR_ASSIGN,
TOKEN_OPERATOR_EQUAL,
TOKEN_OPERATOR_COLON,
+ TOKEN_OPERATOR_COMMA,
TOKEN_OPERATOR_EOL,
+ TOKEN_OPERATOR_FUNCTION,
TOKEN_SYMBOL,
+ TOKEN_KEYWORD_STRUCT,
+ TOKEN_KEYWORD_EXTERNAL,
+ TOKEN_KEYWORD_IMPORT,
TOKEN_PARSED,
} Token;
extern const char *TOKEN_STRINGS[];
+struct ParsedNode;
+
typedef struct Node {
char const *strBegin;
char const *strEnd;
Token token;
- void *parsedNode;
+ struct ParsedNode *parsedNode;
} Node;
typedef struct Nodes {
@@ -39,7 +47,7 @@ typedef struct Nodes {
extern void printNodes(Nodes nodes);
extern void deleteNodes(Nodes nodes);
-extern Nodes lexer(char const *restrict str);
+extern Nodes lexer(char const *const restrict code);
extern void push_if_not_empty(Node **restrict nodes,
size_t *restrict nodes_size,