summaryrefslogtreecommitdiff
path: root/src/compiler/code-generator.c
diff options
context:
space:
mode:
authorA404M <ahmadmahmoudiprogrammer@gmail.com>2025-02-13 15:09:19 +0330
committerA404M <ahmadmahmoudiprogrammer@gmail.com>2025-02-13 15:09:19 +0330
commit441519c4cf0ba7b4d63a2cd761e5553ea925de32 (patch)
tree24f0cf3a8b0bcabcd1786c7e6a7820e7d11e05c1 /src/compiler/code-generator.c
parent142d889fc769532cae922c7ac4b0e80423d671d1 (diff)
add i64
Diffstat (limited to 'src/compiler/code-generator.c')
-rw-r--r--src/compiler/code-generator.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler/code-generator.c b/src/compiler/code-generator.c
index d4ea1b9..665b92a 100644
--- a/src/compiler/code-generator.c
+++ b/src/compiler/code-generator.c
@@ -102,7 +102,7 @@ CodeGeneratorFunctionEnd *newCodeGeneratorFunctionEnd(char *name_begin,
CodeGeneratorOperand *newCodeGeneratorOperandFromAstTree(AstTree tree) {
switch (tree.token) {
- case AST_TREE_TOKEN_VALUE_U64:
+ case AST_TREE_TOKEN_VALUE_INT:
return newCodeGeneratorOperand((void *)(uint64_t)(AstTreeU64)tree.metadata,
false);
case AST_TREE_TOKEN_VARIABLE: {
@@ -214,7 +214,7 @@ CodeGeneratorCodes *codeGenerator(AstTreeRoot *astTreeRoot) {
return NULL;
}
continue;
- case AST_TREE_TOKEN_VALUE_U64:
+ case AST_TREE_TOKEN_VALUE_INT:
if (!variable->isConst) {
CodeGeneratorOperand value = makeCodeGeneratorOperand(
(void *)(uint64_t)(AstTreeU64)variable->value->metadata, false);
@@ -279,7 +279,7 @@ bool codeGeneratorAstTreeFunction(char *name_begin, char *name_end,
goto OK;
case AST_TREE_TOKEN_KEYWORD_PRINT_U64: {
AstTreeSingleChild *metadata = tree->metadata;
- if (metadata->token == AST_TREE_TOKEN_VALUE_U64) {
+ if (metadata->token == AST_TREE_TOKEN_VALUE_INT) {
CodeGeneratorOperand *value = newCodeGeneratorOperand(
(void *)(uint64_t)(AstTreeU64)metadata->metadata, false);
generateCodePushCode(
@@ -361,7 +361,7 @@ bool codeGeneratorAstTreeFunction(char *name_begin, char *name_end,
}
goto OK;
case AST_TREE_TOKEN_VARIABLE_DEFINE:
- case AST_TREE_TOKEN_VALUE_U64:
+ case AST_TREE_TOKEN_VALUE_INT:
case AST_TREE_TOKEN_VARIABLE:
case AST_TREE_TOKEN_FUNCTION:
case AST_TREE_TOKEN_TYPE_TYPE: