diff options
author | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2025-04-11 14:01:12 +0330 |
---|---|---|
committer | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2025-04-11 14:01:12 +0330 |
commit | 399256ab6f75b364773c299847ad2c57a96a7c41 (patch) | |
tree | 9219a6311305771c0af1e5ef776d627ece4c9c5f /src/compiler/ast-tree.h | |
parent | 3a4f7672a416a29fe528c01321858beea9781f47 (diff) |
implement function overloading
Diffstat (limited to 'src/compiler/ast-tree.h')
-rw-r--r-- | src/compiler/ast-tree.h | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/compiler/ast-tree.h b/src/compiler/ast-tree.h index 6d11e16..0ae48f5 100644 --- a/src/compiler/ast-tree.h +++ b/src/compiler/ast-tree.h @@ -200,13 +200,12 @@ typedef struct AstTreeWhile { typedef struct AstTreeHelper { AstTreeVariables **variables; size_t variables_size; - AstTreeVariable *variable; - AstTreeVariables *globalDeps; } AstTreeHelper; typedef struct AstTreeSetTypesHelper { AstTree *lookingType; AstTreeHelper *treeHelper; + AstTreeVariables dependencies; } AstTreeSetTypesHelper; typedef struct AstTreeStruct { @@ -264,8 +263,8 @@ AstTreeRoot *makeAstTree(ParserNode *parsedRoot); bool pushVariable(AstTreeHelper *helper, AstTreeVariables *variables, AstTreeVariable *variable); -AstTreeVariable *getVariable(AstTreeHelper *helper, char *name_begin, - char *name_end); +AstTreeVariables *getAllVariables(AstTreeHelper *helper, char *name_begin, + char *name_end); AstTree *astTreeParse(ParserNode *parserNode, AstTreeHelper *helper); AstTree *astTreeParseFunction(ParserNode *parserNode, AstTreeHelper *helper); @@ -307,15 +306,6 @@ bool typeIsEqual(AstTree *type0, AstTree *type1); bool typeIsEqualBack(const AstTree *type0, const AstTree *type1); AstTree *getValue(AstTree *tree); -bool isCircularDependencies(AstTreeHelper *helper, AstTreeVariable *variable); -bool isCircularDependenciesBack(AstTreeHelper *helper, - AstTreeVariable *variable, AstTree *tree, - AstTreeVariables *checkedVariables); -bool isCircularDependenciesVariable(AstTreeHelper *helper, - AstTreeVariable *toBeFound, - AstTreeVariable *currentVariable, - AstTreeVariables *checkedVariables); - bool setAllTypesRoot(AstTreeRoot *root, AstTreeHelper *helper); bool setAllTypes(AstTree *tree, AstTreeSetTypesHelper helper, AstTreeFunction *function, AstTreeFunctionCall *functionCall); @@ -331,7 +321,8 @@ bool setTypesReturn(AstTree *tree, AstTreeSetTypesHelper helper, AstTreeFunction *function); bool setTypesTypeFunction(AstTree *tree, AstTreeSetTypesHelper helper); bool setTypesFunctionCall(AstTree *tree, AstTreeSetTypesHelper helper); -bool setTypesVariable(AstTree *tree, AstTreeSetTypesHelper helper); +bool setTypesVariable(AstTree *tree, AstTreeSetTypesHelper helper, + AstTreeFunctionCall *functionCall); bool setTypesOperatorAssign(AstTree *tree, AstTreeSetTypesHelper helper); bool setTypesOperatorInfix(AstTree *tree, AstTreeSetTypesHelper helper); bool setTypesOperatorInfixWithRet(AstTree *tree, AstTree *retType, |