/** ** \file assert/desugar-visitor.cc ** \brief Implementation of assert::DesugarVisitor. */ #include namespace assert { DesugarVisitor::DesugarVisitor(const bool desugar_for_p, const bool desugar_string_cmp_p) : super_type(desugar_for_p, desugar_string_cmp_p) {} void DesugarVisitor::operator()(const ast::AssertExp& e) { // FIXME DONE: Some code was deleted here. (replace the AssertExp to a CallExp) const ast::Location location = e.location_get(); const auto args = new ast::exps_type; const std::string condition_text = get_formatted_assert_cond(e); const std::string filename = get_formatted_location(e.location_get()); args->push_back(recurse(e.cond_get())); args->push_back(new ast::StringExp(location, condition_text)); args->push_back(new ast::StringExp(location, filename)); result_ = new ast::CallExp(location, "assertion", args); } } // namespace assert