diff options
author | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2025-02-13 16:42:08 +0330 |
---|---|---|
committer | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2025-02-13 16:42:08 +0330 |
commit | fe459ce514c3dd6352bbc88f9184cb79f35b9cb4 (patch) | |
tree | a3ff67584af541fa505bcfbd6aef75202931ca4c /src/compiler/ast-tree.h | |
parent | 441519c4cf0ba7b4d63a2cd761e5553ea925de32 (diff) |
add == != > >= < <=
Diffstat (limited to 'src/compiler/ast-tree.h')
-rw-r--r-- | src/compiler/ast-tree.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/compiler/ast-tree.h b/src/compiler/ast-tree.h index 1d2f054..798a6b4 100644 --- a/src/compiler/ast-tree.h +++ b/src/compiler/ast-tree.h @@ -33,6 +33,12 @@ typedef enum AstTreeToken { AST_TREE_TOKEN_OPERATOR_MULTIPLY, AST_TREE_TOKEN_OPERATOR_DIVIDE, AST_TREE_TOKEN_OPERATOR_MODULO, + AST_TREE_TOKEN_OPERATOR_EQUAL, + AST_TREE_TOKEN_OPERATOR_NOT_EQUAL, + AST_TREE_TOKEN_OPERATOR_GREATER, + AST_TREE_TOKEN_OPERATOR_SMALLER, + AST_TREE_TOKEN_OPERATOR_GREATER_OR_EQUAL, + AST_TREE_TOKEN_OPERATOR_SMALLER_OR_EQUAL, AST_TREE_TOKEN_SCOPE, @@ -51,6 +57,7 @@ typedef struct AstTree { extern AstTree AST_TREE_TYPE_TYPE; extern AstTree AST_TREE_VOID_TYPE; +extern AstTree AST_TREE_BOOL_TYPE; extern AstTree AST_TREE_I64_TYPE; extern AstTree AST_TREE_U64_TYPE; extern AstTree AST_TREE_VOID_VALUE; @@ -96,7 +103,7 @@ typedef struct AstTreeFunctionCall { size_t parameters_size; } AstTreeFunctionCall; -typedef uint64_t AstTreeU64; +typedef uint64_t AstTreeInt; typedef bool AstTreeBool; @@ -189,6 +196,8 @@ bool setTypesFunctionCall(AstTree *tree, AstTreeSetTypesHelper helper); bool setTypesVariable(AstTree *tree, AstTreeSetTypesHelper helper); bool setTypesOperatorAssign(AstTree *tree, AstTreeSetTypesHelper helper); bool setTypesOperatorInfix(AstTree *tree, AstTreeSetTypesHelper helper); +bool setTypesOperatorInfixWithRet(AstTree *tree, AstTree *retType, + AstTreeSetTypesHelper helper); bool setTypesOperatorUnary(AstTree *tree, AstTreeSetTypesHelper helper); bool setTypesVariableDefine(AstTree *tree, AstTreeSetTypesHelper helper); bool setTypesIf(AstTree *tree, AstTreeSetTypesHelper helper, @@ -196,7 +205,8 @@ bool setTypesIf(AstTree *tree, AstTreeSetTypesHelper helper, bool setTypesScope(AstTree *tree, AstTreeSetTypesHelper helper, AstTreeFunction *function); -bool setTypesAstVariable(AstTreeVariable *variable, AstTreeSetTypesHelper helper); +bool setTypesAstVariable(AstTreeVariable *variable, + AstTreeSetTypesHelper helper); bool setTypesAstInfix(AstTreeInfix *infix, AstTreeSetTypesHelper helper); bool astTreeCleanRoot(AstTreeRoot *root); |