Commit 692c2901 authored by Isaac Oscar Gariano's avatar Isaac Oscar Gariano

More helpfull integer constant error message...

parent 0e1102ee
......@@ -381,7 +381,8 @@ namespace C
virtual Any<std::string> visitCtorInt(UIRParser::CtorIntContext *context) override {
auto val = accept<std::string>(context->intLiteral());
if (!int_sizes.count(current_type))
throw antlr4::RuntimeException("Cannot determine size of integer constant (make sure the type declaration preceds the constant)");
throw antlr4::RuntimeException("Cannot determine size of integer constant (make sure the type declaration preceds the constant) at " +
context->getSourceInterval().toString());
std::size_t size = (std::size_t)int_sizes[current_type];
std::string id;
......
......@@ -325,7 +325,8 @@ namespace Runtime
virtual Any<MuVarNode> visitCtorInt(UIRParser::CtorIntContext *context) override {
auto val = accept<std::string>(context->intLiteral());
if (!int_sizes.count(current_type))
throw antlr4::RuntimeException("Cannot determine size of integer constant (make sure the type declaration preceds the constant)");
throw antlr4::RuntimeException("Cannot determine size of integer constant (make sure the type declaration preceds the constant) at " +
context->getSourceInterval().toString());
std::size_t size = (std::size_t)int_sizes[current_type];
MuID id;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment