diff options
| author | Cori Barker <coribarker2@gmail.com> | 2026-03-07 17:46:38 +0000 |
|---|---|---|
| committer | Cori Barker <coribarker2@gmail.com> | 2026-03-07 17:46:38 +0000 |
| commit | 6761fdd434a7e54551fe28398361f9eed5268406 (patch) | |
| tree | 43f752cc165f6c13b1204dd0e82a219c0d2df4c3 /src | |
| parent | 32ee1c8be581e1967950e125551d672ff65cb04b (diff) | |
code is a complete mess, simplified some classes as they are way too complex will expand in future but too complicated for now since its the first version.
Diffstat (limited to 'src')
| -rw-r--r-- | src/semantic_analyzer.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/semantic_analyzer.cpp b/src/semantic_analyzer.cpp index f6d3d2a..6df7011 100644 --- a/src/semantic_analyzer.cpp +++ b/src/semantic_analyzer.cpp @@ -1,7 +1,5 @@ #include "semantic_analyzer.hpp" -SemanticAnalyzer::SemanticAnalyzer() : symobl_table(new SemanticTable), errors(std::vector<Error>), warnings(std::vector<Error>), current_function(nullptr), current_function_return_type(""), has_main_function(false) {} - bool SemanticAnalyzer::analyze(ASTNode* ast) { symbol_table.enterScope("global") visit(ast); @@ -99,6 +97,8 @@ std::string visitProgram(ProgramNode* node){ for (auto element : functions) { visitFunctionDeclaration(element); }; + + return; } std::string visitFunctionDeclaration(FunctionDeclarationNode* node){ @@ -112,6 +112,7 @@ std::string visitFunctionDeclaration(FunctionDeclarationNode* node){ // exit function scope and clear context // return + current_function = node; } |
