slightly optimize and refactor

This commit is contained in:
2024-10-23 09:25:13 +00:00
parent c6e529ec0f
commit 77719e07e7
7 changed files with 11 additions and 30 deletions

View File

@ -6,6 +6,7 @@
#include "structural_astnode.h"
class ASTSemanticCheckVisitor : public ASTNodeVirturalVisitor {
public:
bool is_in_func_def;
bool has_return;
FunctionSchema cur_func_schema;
@ -13,7 +14,6 @@ class ASTSemanticCheckVisitor : public ASTNodeVirturalVisitor {
bool is_in_class_def;
size_t loop_level;
std::shared_ptr<GlobalScope> global_scope;
friend std::shared_ptr<Program_ASTNode> CheckAndDecorate(std::shared_ptr<Program_ASTNode> src);
bool ClassExists(const std::string &name) {
if (name == "int" || name == "bool") return true;