summaryrefslogtreecommitdiff
path: root/src/compiler/ast-tree.h
diff options
context:
space:
mode:
authorA404M <ahmadmahmoudiprogrammer@gmail.com>2025-01-30 04:50:11 +0330
committerA404M <ahmadmahmoudiprogrammer@gmail.com>2025-01-30 04:50:11 +0330
commite6122f465cd8b8eebcc2657321cf7cf5732408a8 (patch)
tree127d56cab08e99b0999c909db98a417656bf001f /src/compiler/ast-tree.h
parent6441d6ace4b3ebdc04e3e7fee212830f783eecb0 (diff)
added global variables (not constants)
Diffstat (limited to 'src/compiler/ast-tree.h')
-rw-r--r--src/compiler/ast-tree.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/compiler/ast-tree.h b/src/compiler/ast-tree.h
index b9c1585..90133a5 100644
--- a/src/compiler/ast-tree.h
+++ b/src/compiler/ast-tree.h
@@ -16,6 +16,7 @@ typedef enum AstTreeToken {
AST_TREE_TOKEN_FUNCTION_CALL,
AST_TREE_TOKEN_VARIABLE,
+ AST_TREE_TOKEN_VARIABLE_DEFINE,
AST_TREE_TOKEN_VALUE_U64,
AST_TREE_TOKEN_NONE,
@@ -32,6 +33,7 @@ typedef struct AstTreeVariable {
char *name_end;
AstTree *type;
AstTree *value;
+ bool isConst;
} AstTreeVariable;
typedef struct AstTreeVariables {
@@ -118,8 +120,13 @@ AstTree *astTreeParsePrintU64(ParserNode *parserNode,
bool astTreeParseConstant(ParserNode *parserNode, AstTreeVariables **variables,
size_t variables_size);
+AstTree *astTreeParseVariable(ParserNode *parserNode,
+ AstTreeVariables **variables,
+ size_t variables_size);
+
bool hasTypeOf(AstTree *value, const AstTree *type);
bool isFunction(AstTree *value);
+bool isConst(AstTree *value);
AstTree *makeTypeOf(AstTree *value);
bool typeIsEqual(const AstTree *type0, const AstTree *type1);