23 lines
590 B
C++
23 lines
590 B
C++
#include "macro.hpp"
|
|
|
|
std::shared_ptr<Constant> assert_fail(Node const& node,
|
|
Compiler& compiler,
|
|
Program& program,
|
|
SymTable& sym)
|
|
{
|
|
try
|
|
{
|
|
compiler.compile(*node.child_at(1), program);
|
|
Loc loc = node.loc();
|
|
|
|
std::cerr << loc.file_path().string() << ":" << loc.line();
|
|
std::cerr << " ASSERTION FAILED" << std::endl;
|
|
exit(-1);
|
|
}
|
|
catch (std::exception const&)
|
|
{
|
|
}
|
|
|
|
return std::make_shared<Constant>(TYPE_NIL, node.loc(), 0);
|
|
}
|