summaryrefslogtreecommitdiff
path: root/src/compiler/ast-tree.h
diff options
context:
space:
mode:
authorA404M <ahmadmahmoudiprogrammer@gmail.com>2025-01-28 03:40:39 +0330
committerA404M <ahmadmahmoudiprogrammer@gmail.com>2025-01-28 03:44:01 +0330
commit5adca3ef1277b9e7f8f4d77e1b2ecce9ad78d76b (patch)
tree1abc6fe5850b90b6c3956538e8be93ce1ebdb672 /src/compiler/ast-tree.h
parentaa69d90b4f0d8bb0d320c245ebf9b47741f655fe (diff)
clean syntax to not allowing variable definition else where
Diffstat (limited to 'src/compiler/ast-tree.h')
-rw-r--r--src/compiler/ast-tree.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/compiler/ast-tree.h b/src/compiler/ast-tree.h
index 8dba559..7f3e3dc 100644
--- a/src/compiler/ast-tree.h
+++ b/src/compiler/ast-tree.h
@@ -9,6 +9,7 @@ typedef enum AstTreeToken {
AST_TREE_TOKEN_KEYWORD_PRINT_U64,
+ AST_TREE_TOKEN_TYPE_TYPE,
AST_TREE_TOKEN_TYPE_FUNCTION,
AST_TREE_TOKEN_TYPE_VOID,
AST_TREE_TOKEN_TYPE_U64,
@@ -17,8 +18,6 @@ typedef enum AstTreeToken {
AST_TREE_TOKEN_VARIABLE,
AST_TREE_TOKEN_VALUE_U64,
- AST_TREE_TOKEN_VARIABLE_DEFINE,
-
AST_TREE_TOKEN_NONE,
} AstTreeToken;
@@ -83,6 +82,7 @@ void astTreeDelete(AstTree *tree);
void astTreeRootDelete(AstTreeRoot *root);
AstTree *newAstTree(AstTreeToken token, void *metadata);
+AstTree *copyAstTree(AstTree *tree);
AstTreeRoot *makeAstTree(ParserNode *parsedRoot);
@@ -114,9 +114,10 @@ AstTree *astTreeParsePrintU64(ParserNode *parserNode,
AstTreeVariables **variables,
size_t variables_size);
-AstTree *astTreeParseConstant(ParserNode *parserNode,
+bool astTreeParseConstant(ParserNode *parserNode,
AstTreeVariables **variables,
size_t variables_size);
bool hasTypeOf(AstTree *value, AstTree *type);
+AstTree *makeTypeOf(AstTree *value);
bool typeIsEqual(AstTree *type0, AstTree *type1);