mark compilerError as noreturn
This commit is contained in:
parent
f169088f36
commit
56330a54ad
|
@ -17,7 +17,7 @@ class ErrorListener : public antlr4::BaseErrorListener {
|
|||
|
||||
bool hasError();
|
||||
|
||||
void compilerError(const std::string &file, size_t line);
|
||||
[[noreturn]] void compilerError(const std::string &file, size_t line);
|
||||
void duplicateFunction(antlr4::Token *token, const std::string &name);
|
||||
void shadowedVariable(antlr4::Token *token, const std::string &name);
|
||||
void syntaxError(antlr4::Recognizer *recognizer,
|
||||
|
|
|
@ -63,7 +63,6 @@ std::any TypeCheckVisitor::visitType(xlangParser::TypeContext *ctx) {
|
|||
}
|
||||
// unreachable
|
||||
errorlistener.compilerError(__FILE__, __LINE__);
|
||||
return {};
|
||||
}
|
||||
|
||||
std::any TypeCheckVisitor::visitBlock(xlangParser::BlockContext *ctx) {
|
||||
|
@ -97,7 +96,6 @@ std::any TypeCheckVisitor::visitStatement(xlangParser::StatementContext *ctx) {
|
|||
}
|
||||
// unreachable
|
||||
errorlistener.compilerError(__FILE__, __LINE__);
|
||||
return {};
|
||||
}
|
||||
if (auto condition = ctx->condition()) {
|
||||
auto type = std::any_cast<Type>(visitCondition(condition));
|
||||
|
@ -131,7 +129,6 @@ std::any TypeCheckVisitor::visitValue(xlangParser::ValueContext *ctx) {
|
|||
}
|
||||
// unreachable
|
||||
errorlistener.compilerError(__FILE__, __LINE__);
|
||||
return {};
|
||||
}
|
||||
|
||||
#define CHECKOPERATOR(visitLeft, left, visitRight, right, expected) \
|
||||
|
@ -257,7 +254,6 @@ std::any TypeCheckVisitor::visitVariable(xlangParser::VariableContext *ctx) {
|
|||
}
|
||||
// unreachable
|
||||
errorlistener.compilerError(__FILE__, __LINE__);
|
||||
return {};
|
||||
}
|
||||
|
||||
} // namespace xlang
|
||||
|
|
Loading…
Reference in a new issue