diff --git a/libwccl/ops/conditional.h b/libwccl/ops/conditional.h index 80398fdfa8ba996f1a64887e6830e8d2962830f0..580b02d827e74dadc8a354e5545c3156fb23eb0e 100644 --- a/libwccl/ops/conditional.h +++ b/libwccl/ops/conditional.h @@ -119,7 +119,7 @@ template<class T> std::string Conditional<T>::to_raw_string() const { std::stringstream ss; - ss << boost::format("%1% %2% then %3% else %4%") + ss << boost::format("%1%(%2%, %3%, %4%)") % this->raw_operator_name() % this->cond_expr_->to_raw_string() % this->iftrue_expr_->to_raw_string() @@ -131,7 +131,7 @@ template<class T> std::string Conditional<T>::to_string(const Corpus2::Tagset &tagset) const { std::stringstream ss; - ss << boost::format("%1% %2% then %3% else %4%") + ss << boost::format("%1%(%2%, %3%, %4%)") % this->operator_name(tagset) % this->cond_expr_->to_string(tagset) % this->iftrue_expr_->to_string(tagset) diff --git a/tests/conditional.cpp b/tests/conditional.cpp index cfa78ab32f504c9853c03f3d9c9f9ed667b53a17..e6e5d55b036601ffb1501919739bab303c23d3e4 100644 --- a/tests/conditional.cpp +++ b/tests/conditional.cpp @@ -119,7 +119,7 @@ BOOST_FIXTURE_TEST_CASE(cond_to_string, CondFixStrSet) true_constant, empty_strset_expr, one_elem_strset_expr)); - std::string expected = "if True then [] else [\"oNe\"]"; + std::string expected = "if(True, [], [\"oNe\"])"; BOOST_CHECK_EQUAL(expected, cond->to_string(tagset)); } @@ -128,7 +128,7 @@ BOOST_FIXTURE_TEST_CASE(cond_to_string_raw, CondFixStrSet) boost::shared_ptr<Conditional<StrSet> > cond(new Conditional<StrSet>( true_constant, one_elem_strset_expr)); - std::string expected = "if True then [\"oNe\"] else []"; + std::string expected = "if(True, [\"oNe\"], [])"; BOOST_CHECK_EQUAL(expected, cond->to_string(tagset)); }