diff options
author | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2025-02-07 22:16:18 +0330 |
---|---|---|
committer | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2025-02-07 22:16:18 +0330 |
commit | 34099f0d7752a2fab5eadccfeb578b77b292c889 (patch) | |
tree | 31c628e40f802b58db8bb27d5a3d4a6ead7a57d7 /src/compiler/ast-tree.h | |
parent | 6bd439f35c1184f04488ee4f0db21632e1301b51 (diff) |
add return
Diffstat (limited to 'src/compiler/ast-tree.h')
-rw-r--r-- | src/compiler/ast-tree.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/compiler/ast-tree.h b/src/compiler/ast-tree.h index 28e74af..64068d3 100644 --- a/src/compiler/ast-tree.h +++ b/src/compiler/ast-tree.h @@ -8,6 +8,7 @@ typedef enum AstTreeToken { AST_TREE_TOKEN_FUNCTION, AST_TREE_TOKEN_KEYWORD_PRINT_U64, + AST_TREE_TOKEN_KEYWORD_RETURN, AST_TREE_TOKEN_TYPE_TYPE, AST_TREE_TOKEN_TYPE_FUNCTION, @@ -88,6 +89,10 @@ typedef struct AstTreeInfix { AstTree right; } AstTreeInfix; +typedef struct AstTreeReturn { + AstTree *value; +} AstTreeReturn; + void astTreePrint(const AstTree *tree, int indent); void astTreeRootPrint(const AstTreeRoot *root); @@ -129,6 +134,9 @@ AstTree *astTreeParseIdentifier(ParserNode *parserNode, AstTree *astTreeParsePrintU64(ParserNode *parserNode, AstTreeVariables **variables, size_t variables_size); +AstTree *astTreeParseReturn(ParserNode *parserNode, + AstTreeVariables **variables, + size_t variables_size); AstTree *astTreeParseAssign(ParserNode *parserNode, AstTreeVariables **variables, @@ -150,9 +158,10 @@ AstTree *makeTypeOf(AstTree *value); bool typeIsEqual(const AstTree *type0, const AstTree *type1); bool setAllTypesRoot(AstTreeRoot *root); -bool setAllTypes(AstTree *tree); +bool setAllTypes(AstTree *tree,AstTreeFunction *function); bool setTypesFunction(AstTree *tree); bool setTypesPrintU64(AstTree *tree); +bool setTypesReturn(AstTree *tree,AstTreeFunction *function); bool setTypesTypeFunction(AstTree *tree); bool setTypesFunctionCall(AstTree *tree); bool setTypesVariable(AstTree *tree); |