Commit acb20a5e authored by Isaac Oscar Gariano's avatar Isaac Oscar Gariano

Some more error messages

parent bf1e00c1
......@@ -1359,6 +1359,10 @@ namespace C
void c_compile(std::string ctx, std::string filename, std::ostream& output, std::string irbuilder) {
std::ifstream input_file (filename);
if (input_file.fail()) {
throw antlr4::RuntimeException("Couldn't oppen file \""s + filename + "\""s);
}
antlr4::ANTLRInputStream input(input_file);
UIRLexer lexer(&input);
......
......@@ -1375,6 +1375,10 @@ namespace Runtime
void runtime_compile(MuCtx* ctx, std::string filename) {
std::ifstream input_file (filename);
if (input_file.fail()) {
throw antlr4::RuntimeException("Couldn't oppen file \""s + filename + "\""s);
}
antlr4::ANTLRInputStream input(input_file);
UIRLexer lexer(&input);
......
......@@ -118,6 +118,10 @@ int main(int argc, char* argv[]) {
return -1;
}
if (has_primordial && Runtime::primordial_id == MU_NO_ID) {
std::cerr << "ERROR: couldn't find primordial function \"" << ::primordial_name << "\"" << std::endl;
return -1;
}
MuFuncRefValue primordial_exp = has_primordial ?
ctx->handle_from_func(ctx, Runtime::primordial_id) : nullptr;
......@@ -162,6 +166,11 @@ int main(int argc, char* argv[]) {
return -1;
}
if (has_primordial && Runtime::primordial_id == MU_NO_ID) {
std::cerr << "ERROR: couldn't find primordial function \"" << ::primordial_name << "\"" << std::endl;
return -1;
}
std::string primordial_exp = has_primordial ?
ctx + "->handle_from_func("s + ctx + ", "s + C::primordial_id + ")"s : "NULL"s;
......
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