Om
environment_operation.cpp
Go to the documentation of this file.
1 
15 #ifndef Om_Language_Operation_EnvironmentOperation_
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(EnvironmentOperationTest)
36 
37  BOOST_AUTO_TEST_CASE(DefinitionTest) {
38  BOOST_CHECK_EQUAL(
39  "{environment}",
40  System::Get().Evaluate("drop find {environment} system")
41  );
42  }
43 
44  BOOST_AUTO_TEST_CASE(GeneralTest) {
45  BOOST_CHECK_EQUAL(
46  "{pass}",
47  System::Get().Evaluate(
48  "choose"
49  " {fail}"
50  " {pass}"
51  " = define {a{A}} {environment} [lexicon]<- {a{A}} system"
52  )
53  );
54  }
55 
56  BOOST_AUTO_TEST_SUITE_END()
57 
58  }
59 
60  }
61 
62 }
63 
64  #endif
65 
66 #else
67 
68 // MARK: - Om::Language::Operation::EnvironmentOperation
69 
70  #define Type_ \
71  Om::Language::Operation::EnvironmentOperation
72 
73 // MARK: public (static)
74 
75 inline char const * Type_::GetName() {
77 }
78 
79 inline void Type_::Give(Evaluation & theEvaluation) {
80  Lexicon theLexicon;
81  theEvaluation.GetTranslator().GiveElements(theLexicon);
82  theEvaluation.TakeQuotedProducer(theLexicon);
83 }
84 
85  #undef Type_
86 
87 #endif
static System & Get()
#define Om_Language_Operation_EnvironmentOperation_GetName_()
The Om library.
Definition: code_point.hpp:26
std::auto_ptr< TheGiveable > Give(TheGiveable &)
Calls Move on the object.
Om header file.