summaryrefslogtreecommitdiff
path: root/src/compiler/ast-tree.h
diff options
context:
space:
mode:
authorA404M <ahmadmahmoudiprogrammer@gmail.com>2025-01-27 01:25:24 +0330
committerA404M <ahmadmahmoudiprogrammer@gmail.com>2025-01-27 01:25:24 +0330
commit64331c144518b8ab1c3cf08473771e0d3f14f67b (patch)
treec378fccbddcc4e0972a7a426b4bf464efc1129bf /src/compiler/ast-tree.h
parentbb87887ec288f341256d324f271bac6267fc83f4 (diff)
add print_u64 to be able to print u64 numbers
Diffstat (limited to 'src/compiler/ast-tree.h')
-rw-r--r--src/compiler/ast-tree.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/compiler/ast-tree.h b/src/compiler/ast-tree.h
index e92cb08..8a7617d 100644
--- a/src/compiler/ast-tree.h
+++ b/src/compiler/ast-tree.h
@@ -2,14 +2,17 @@
#include "compiler/parser.h"
#include <stddef.h>
+#include <stdint.h>
typedef enum AstTreeToken {
AST_TREE_TOKEN_FUNCTION,
AST_TREE_TOKEN_KEYWORD_PRINT,
+ AST_TREE_TOKEN_KEYWORD_PRINT_U64,
AST_TREE_TOKEN_TYPE_FUNCTION,
AST_TREE_TOKEN_TYPE_VOID,
AST_TREE_TOKEN_FUNCTION_CALL,
AST_TREE_TOKEN_IDENTIFIER,
+ AST_TREE_TOKEN_VALUE_U64,
AST_TREE_TOKEN_NONE,
} AstTreeToken;
@@ -62,6 +65,10 @@ typedef struct AstTreeFunctionCall {
typedef AstTreeVariable AstTreeIdentifier;
+typedef uint64_t AstTreeU64;
+
+typedef AstTree AstTreeSingleChild;
+
extern const char *AST_TREE_TOKEN_STRINGS[];
void astTreePrint(const AstTree *tree, int indent);
@@ -100,5 +107,9 @@ AstTree *astTreeParseIdentifier(ParserNode *parserNode,
AstTreeVariables *variables,
size_t variables_size);
+AstTree *astTreeParsePrintU64(ParserNode *parserNode,
+ AstTreeVariables *variables,
+ size_t variables_size);
+
bool hasTypeOf(AstTree *value, AstTree *type);
bool typeIsEqual(AstTree *type0, AstTree *type1);