Om
drop_operation.cpp
Go to the documentation of this file.
1 
15 #ifndef Om_Language_Operation_DropOperation_
16 
18 
19  #ifdef Om_Macro_Test_
20 
21  #include "om/language/system.hpp"
22 
23  #ifndef Om_Macro_Precompilation_
24 
25  #include "boost/test/unit_test.hpp"
26 
27  #endif
28 
29 namespace Om {
30 
31  namespace Language {
32 
33  namespace Operation {
34 
35  BOOST_AUTO_TEST_SUITE(DropOperationTest)
36 
37  BOOST_AUTO_TEST_CASE(DefinitionTest) {
38  BOOST_CHECK_EQUAL(
39  "{drop}",
40  System::Get().Evaluate("drop find {drop} system")
41  );
42  }
43 
44  BOOST_AUTO_TEST_CASE(SimpleTest) {
45  BOOST_CHECK_EQUAL(
46  "{4{5}6}",
47  System::Get().Evaluate("drop {1{2}3}{4{5}6}")
48  );
49  }
50 
51  BOOST_AUTO_TEST_SUITE_END()
52 
53  }
54 
55  }
56 
57 }
58 
59  #endif
60 
61 #else
62 
63 // MARK: - Om::Language::Operation::DropOperation
64 
65  #define Type_ \
66  Om::Language::Operation::DropOperation
67 
68 // MARK: public (static)
69 
70 inline char const * Type_::GetName() {
72 }
73 
74 template <typename TheDropOperation>
75 inline void Type_::GiveElements(
76  TheDropOperation &,
77  Consumer & theConsumer
78 ) {
79  theConsumer.TakeElement(
80  GetOperator()
81  );
82 }
83 
84 // MARK: public (non-static)
85 
86 inline bool Type_::ParseQuotedElements(
87  Evaluation &,
88  Reader & theReader
89 ) {
90  while (theReader) {
91  theReader.Pop();
92  }
93  return true;
94 }
95 
96 template <typename TheOperand>
97 inline bool Type_::TakeOperand(
98  Evaluation &,
99  TheOperand &
100 ) {
101  return true;
102 }
103 
104 template <typename TheProducer>
105 inline bool Type_::TakeQuotedProducer(
106  Evaluation &,
107  TheProducer &
108 ) {
109  return true;
110 }
111 
112  #undef Type_
113 
114 #endif
static System & Get()
Om header file.
#define Om_Language_Operation_DropOperation_GetName_()
The Om library.
Definition: code_point.hpp:26
Om header file.