From 441519c4cf0ba7b4d63a2cd761e5553ea925de32 Mon Sep 17 00:00:00 2001 From: A404M Date: Thu, 13 Feb 2025 15:09:19 +0330 Subject: add i64 --- src/compiler/code-generator.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/compiler/code-generator.c') 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: -- cgit v1.2.3