From 6761fdd434a7e54551fe28398361f9eed5268406 Mon Sep 17 00:00:00 2001 From: Cori Barker Date: Sat, 7 Mar 2026 17:46:38 +0000 Subject: 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. --- src/semantic_analyzer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/semantic_analyzer.cpp') 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), warnings(std::vector), 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; } -- cgit v1.2.3