Skip to content

Commit

Permalink
Exit prematurely if we detect 9 errors to prevent flooding output.
Browse files Browse the repository at this point in the history
  • Loading branch information
rdtscp committed May 16, 2019
1 parent 42bdbec commit a78e485
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 0 additions & 1 deletion include/passes/SemanticAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ class SemanticAnalysis : public ASTVisitor<atl::shared_ptr<Type>> {

/* Helpers */
atl::shared_ptr<Type> collapseReferenceTypes(atl::shared_ptr<Type> type);
// TODO: ~Create: Type preventCascade(const Type t);
};

} // namespace ACC
4 changes: 4 additions & 0 deletions src/passes/SemanticAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ SemanticAnalysis::error(const atl::string &errorType, const atl::string &error,
errorCount++;
errors.push_back(errorType + " Error at: " + node->position.toString() +
"\n\t" + error);
if (errorCount == 9) {
printErrors();
throw Error("9 Semantic Errors: Exiting Prematurely");
}
return atl::shared_ptr<BaseType>(new BaseType(PrimitiveType::NULLPTR_T));
}

Expand Down

0 comments on commit a78e485

Please sign in to comment.