15 #ifndef Om_Language_Operation_FillOperation_
21 #ifndef Om_Macro_Precompilation_
23 #include "boost/test/unit_test.hpp"
33 BOOST_AUTO_TEST_SUITE(FillOperationTest)
35 BOOST_AUTO_TEST_CASE(DefinitionTest) {
42 BOOST_AUTO_TEST_CASE(GeneralTest) {
51 System::Get().Evaluate(
"fill{a b{B} c}{A}{C}{Unused}")
65 BOOST_AUTO_TEST_CASE(EarlyTerminationTest) {
74 System::Get().Evaluate(
"fill{a b{B} c}{A}}{C}{Unused}")
83 BOOST_AUTO_TEST_SUITE_END()
95 #ifndef Om_Macro_Precompilation_
97 #include "boost/utility/in_place_factory.hpp"
104 Om::Language::Operation::FillOperation
108 inline char const * Type_::GetName() {
112 template <
typename TheFillOperation>
113 inline void Type_::GiveElements(
114 TheFillOperation & theFillOperation,
115 Consumer & theConsumer
117 theConsumer.TakeElement(
120 if (theFillOperation.thisFormRange) {
121 theConsumer.TakeQuotedElements(theFillOperation.thisExpression);
127 inline Type_::FillOperation():
131 template <
typename TheOperand>
132 inline bool Type_::TakeOperand(
133 Evaluation & theEvaluation,
134 TheOperand & theOperand
137 !theOperand.IsEmpty()
139 return this->TakeQuotedProducer(
141 *theOperand.GetProgram()
145 template <
typename TheProducer>
146 inline bool Type_::TakeQuotedProducer(
147 Evaluation & theEvaluation,
148 TheProducer & theProducer
150 if (this->thisFormRange) {
151 FormRange & theFormRange = *this->thisFormRange;
154 !this->thisExpression.IsEmpty()
157 !Form::OperandRange<Operand const>(*theFormRange) &&
158 "The Form should have no Operands."
160 theFormRange->BackTakeQuotedProducer(theProducer);
163 this->thisExpression.TakeElements(theProducer);
164 this->thisFormRange = boost::in_place(
165 boost::ref(this->thisExpression)
168 assert(this->thisFormRange);
172 FormRange & theFormRange = *this->thisFormRange;
177 !Form::OperandRange<Operand const>(*theFormRange)
182 theEvaluation.TakeQuotedProducer(this->thisExpression);
#define Om_Language_Operation_FillOperation_GetName_()