From cb26dd0fc9c1e33be1c32eb85b04434526004e6a Mon Sep 17 00:00:00 2001 From: A404M Date: Sat, 8 Feb 2025 10:58:07 +0330 Subject: add bool --- src/runner/runner.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/runner/runner.c') diff --git a/src/runner/runner.c b/src/runner/runner.c index 50d87df..606fe89 100644 --- a/src/runner/runner.c +++ b/src/runner/runner.c @@ -78,8 +78,10 @@ AstTree *runAstTreeFunction(AstTreeFunction *function, AstTree **arguments, case AST_TREE_TOKEN_TYPE_FUNCTION: case AST_TREE_TOKEN_TYPE_VOID: case AST_TREE_TOKEN_TYPE_U64: + case AST_TREE_TOKEN_TYPE_BOOL: case AST_TREE_TOKEN_VARIABLE: case AST_TREE_TOKEN_VALUE_U64: + case AST_TREE_TOKEN_VALUE_BOOL: case AST_TREE_TOKEN_NONE: } printLog("%d", expr.token); @@ -94,6 +96,9 @@ AstTree *calcAstTreeValue(AstTree *tree) { case AST_TREE_TOKEN_VALUE_U64: { return deepCopyAstTree(tree); } + case AST_TREE_TOKEN_VALUE_BOOL: { + return deepCopyAstTree(tree); + } case AST_TREE_TOKEN_VARIABLE: { AstTreeVariable *variable = tree->metadata; return calcAstTreeValue(variable->value); @@ -132,6 +137,7 @@ AstTree *calcAstTreeValue(AstTree *tree) { case AST_TREE_TOKEN_TYPE_FUNCTION: case AST_TREE_TOKEN_TYPE_VOID: case AST_TREE_TOKEN_TYPE_U64: + case AST_TREE_TOKEN_TYPE_BOOL: case AST_TREE_TOKEN_VARIABLE_DEFINE: case AST_TREE_TOKEN_OPERATOR_ASSIGN: case AST_TREE_TOKEN_NONE: @@ -142,6 +148,7 @@ AstTree *calcAstTreeValue(AstTree *tree) { AstTree *deepCopyAstTree(AstTree *tree) { switch (tree->token) { case AST_TREE_TOKEN_VALUE_U64: + case AST_TREE_TOKEN_VALUE_BOOL: return newAstTree(tree->token, tree->metadata, copyAstTree(tree->type)); case AST_TREE_TOKEN_VARIABLE: case AST_TREE_TOKEN_FUNCTION: @@ -151,6 +158,7 @@ AstTree *deepCopyAstTree(AstTree *tree) { case AST_TREE_TOKEN_TYPE_FUNCTION: case AST_TREE_TOKEN_TYPE_VOID: case AST_TREE_TOKEN_TYPE_U64: + case AST_TREE_TOKEN_TYPE_BOOL: case AST_TREE_TOKEN_FUNCTION_CALL: case AST_TREE_TOKEN_VARIABLE_DEFINE: case AST_TREE_TOKEN_OPERATOR_ASSIGN: -- cgit v1.2.3