From 3a079c1da7508839088c0c70795819692954eb43 Mon Sep 17 00:00:00 2001 From: A404M Date: Thu, 5 Jun 2025 07:50:03 +0330 Subject: fix some bugs --- src/compiler/ast-tree.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/compiler/ast-tree.h') diff --git a/src/compiler/ast-tree.h b/src/compiler/ast-tree.h index b643dc9..eac7722 100644 --- a/src/compiler/ast-tree.h +++ b/src/compiler/ast-tree.h @@ -287,6 +287,7 @@ typedef struct AstTreeSetTypesHelper { AstTreeWhile **loops; size_t loops_size; AstTreeScope *scope; + bool isInScope; } AstTreeSetTypesHelper; typedef struct AstTreeStruct { @@ -357,6 +358,7 @@ void astTreeVariablePrint(const AstTreeVariable *variable, int indent); void astTreeRootPrint(const AstTreeRoot *root); #endif +void astTreeScopeDestroy(AstTreeScope scope); void astTreeFunctionDestroy(AstTreeFunction function); void astTreeDeleteFunctionCall(AstTreeFunctionCall *functionCall); void astTreeDestroy(AstTree tree); @@ -454,13 +456,13 @@ bool isConst(AstTree *tree); AstTree *makeTypeOf(AstTree *value); AstTree *makeTypeOfFunction(AstTreeFunction *function, const char *str_begin, const char *str_end); -bool typeIsEqual(AstTree *type0, AstTree *type1); -bool typeIsEqualBack(const AstTree *type0, const AstTree *type1); -AstTree *getValue(AstTree *tree, bool copy); +bool typeIsEqual(AstTree *type0, AstTree *type1, AstTreeScope *scope); +bool typeIsEqualBack(const AstTree *type0, const AstTree *type1,AstTreeScope *scope); +AstTree *getValue(AstTree *tree, bool copy, AstTreeScope *scope); bool isIntType(AstTree *type); bool isFloatType(AstTree *type); -bool isEqual(AstTree *left, AstTree *right); -bool isEqualVariable(AstTreeVariable *left, AstTreeVariable *right); +bool isEqual(AstTree *left, AstTree *right,AstTreeScope *scope); +bool isEqualVariable(AstTreeVariable *left, AstTreeVariable *right,AstTreeScope *scope); void allOfVariablesWithImport(AstTreeVariables *variables, AstTreeRoot *root, AstTreeRoots *checkedRoots); -- cgit v1.2.3