Skip to content

Commit

Permalink
XX
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
  • Loading branch information
mballance committed Nov 8, 2023
1 parent cf02a77 commit 8d6c72e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/TaskBuildSymbolTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ void TaskBuildSymbolTree::visitFunctionPrototype(ast::IFunctionPrototype *i) {
// If the existing symbol isn't a FunctionScope, then we have
// a duplicate symbol
if (ex_func_b && !func_sym) {
DEBUG("Duplicate symbol");
reportDuplicateSymbol(m_scope_s.back(), ex_func_b, i);
return;
}
Expand All @@ -453,6 +454,8 @@ void TaskBuildSymbolTree::visitFunctionPrototype(ast::IFunctionPrototype *i) {
func_sym->setUpper(m_scope_s.back());
m_scope_s.back()->getSymtab().insert({func_sym->getName(), id});
m_scope_s.back()->getChildren().push_back(func_sym);
} else {
DEBUG("Note: Function %s is already defined", func_sym->getName().c_str());
}

func_sym->getPrototypes().push_back(i);
Expand Down
26 changes: 22 additions & 4 deletions src/include/zsp/parser/impl/TaskCopyAst.h
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ class TaskCopyAst : public ast::VisitorBase {
virtual void visitPackageScope(ast::IPackageScope *i) { }

virtual void visitFunctionPrototype(ast::IFunctionPrototype *i) override {
DEBUG_ENTER("visitFunctionPrototype %s", i->getName().c_str());
ast::IFunctionPrototype *ic = m_factory->mkFunctionPrototype(
copyT<ast::IExprId>(i->getName()),
(i->getRtype())?copy(i->getRtype()):0,
Expand All @@ -443,11 +444,20 @@ class TaskCopyAst : public ast::VisitorBase {
}

m_sc = ic;
DEBUG_ENTER("visitFunctionPrototype");
}

virtual void visitFunctionImportType(ast::IFunctionImportType *i) { }
virtual void visitFunctionImportType(ast::IFunctionImportType *i) {
DEBUG_ENTER("visitFunctionImportType");
DEBUG("TODO: visitFunctionImportType");
DEBUG_LEAVE("visitFunctionImportType");
}

virtual void visitFunctionImportProto(ast::IFunctionImportProto *i) { }
virtual void visitFunctionImportProto(ast::IFunctionImportProto *i) {
DEBUG_ENTER("visitFunctionImportProto");
DEBUG("TODO: visitFunctionImportProto");
DEBUG_LEAVE("visitFunctionImportProto");
}

virtual void visitDataTypeArray(ast::IDataTypeArray *i) { }

Expand Down Expand Up @@ -523,9 +533,17 @@ class TaskCopyAst : public ast::VisitorBase {

virtual void visitSymbolExtendScope(ast::ISymbolExtendScope *i) { }

virtual void visitSymbolTypeScope(ast::ISymbolTypeScope *i) { }
virtual void visitSymbolTypeScope(ast::ISymbolTypeScope *i) {
DEBUG_ENTER("visitSymbolTypeScope %s", i->getName().c_str());
DEBUG("TODO: visitSymbolTypeScope %s", i->getName().c_str());
DEBUG_LEAVE("visitSymbolTypeScope %s", i->getName().c_str());
}

virtual void visitSymbolFunctionScope(ast::ISymbolFunctionScope *i) { }
virtual void visitSymbolFunctionScope(ast::ISymbolFunctionScope *i) {
DEBUG_ENTER("visitSymbolFunctionScope %s", i->getName().c_str());
DEBUG("TODO: visitSymbolFunctionScope %s", i->getName().c_str());
DEBUG_LEAVE("visitSymbolFunctionScope %s", i->getName().c_str());
}

virtual void visitTemplateGenericTypeParamDecl(ast::ITemplateGenericTypeParamDecl *i) { }

Expand Down

0 comments on commit 8d6c72e

Please sign in to comment.