15 #ifndef Om_Language_Operation_DecodeOperation_
23 #ifndef Om_Macro_Precompilation_
25 #include "boost/test/unit_test.hpp"
35 BOOST_AUTO_TEST_SUITE(DecodeOperationTest)
37 BOOST_AUTO_TEST_CASE(DefinitionTest) {
44 BOOST_AUTO_TEST_CASE(SimpleTest) {
46 "{`{`}` {{}} {quote{s}} }",
47 System::Get().Evaluate(
"decode {```{```}``` `{`{`}`}` {quote{s}} }")
51 "{{} {{}} {quote{s}} }",
52 System::Get().Evaluate(
"decode {`{`}` {{}} {quote{s}} }")
56 "{ the {end: `} really: } ! }",
57 System::Get().Evaluate(
"decode {` the` `{end:` ```}` really:` `}` !` }")
62 "{ the {end: } really: }",
63 System::Get().Evaluate(
"decode { the {end: `} really: } ! }")
67 "{ the {end: } really: }",
68 System::Get().Evaluate(
"decode { the {end: } really: }")
72 BOOST_AUTO_TEST_SUITE_END()
89 Om::Language::Operation::DecodeOperation
93 inline char const * Type_::GetName() {
97 template <
typename TheDecodeOperation>
98 inline void Type_::GiveElements(
100 Consumer & theConsumer
102 theConsumer.TakeElement(
109 template <
typename TheOperand>
110 inline bool Type_::TakeOperand(
111 Evaluation & theEvaluation,
112 TheOperand & theOperand
115 !theOperand.IsEmpty()
117 return this->TakeQuotedProducer(
119 *theOperand.GetProgram()
123 template <
typename TheProducer>
124 inline bool Type_::TakeQuotedProducer(
125 Evaluation & theEvaluation,
126 TheProducer & theProducer
130 Operator theOperator;
131 theOperator.TakeElements(theProducer);
132 theOperator.Decode(theLiteral);
134 theEvaluation.TakeQuotedProducer(theLiteral);
#define Om_Language_Operation_DecodeOperation_GetName_()