Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

71 lines (52 sloc) 1.6 kb
// errors.cpp
// Revision 3-feb-2011
#include "errors.h"
//**********************************************************************
InternalError::InternalError(const std::string &msg) :
std::runtime_error(msg)
{
}
//**********************************************************************
CompileError::CompileError(const std::string &msg) :
std::runtime_error(msg)
{
}
CompileError::CompileError(const std::string &msg, const Token &where) :
std::runtime_error(msg + " (found: " + where.describe() + " )"),
w(where)
{
}
unsigned int CompileError::linenum() const
{
return w.linenum();
}
std::string CompileError::file() const
{
return w.file();
}
//**********************************************************************
Unsupported::Unsupported(const std::string &msg, const Token &where) :
CompileError("Unsupported feature: " + msg, where)
{
}
//**********************************************************************
UnsupportedInStage::UnsupportedInStage(const std::string &msg,
const Token &where) :
CompileError("Unsupported in stage 0: " + msg, where)
{
}
//**********************************************************************
SyntaxError::SyntaxError(const std::string &msg, const Token &where) :
CompileError("Syntax error: " + msg, where)
{
}
//**********************************************************************
Expected::Expected(char msg, const Token &where) :
SyntaxError(std::string("Expected '") + msg + '\'', where)
{
}
Expected::Expected(const std::string &msg, const Token &where) :
SyntaxError("Expected " + msg, where)
{
}
// End of errors.cpp
Jump to Line
Something went wrong with that request. Please try again.