No idea what I am doing here
[fridhskrift.git] / variable / logical_operator.cpp
blob2e8b4d21c91de0c6e43bb6de702bd6882a421c63
1 #include <frith/variable.hpp>
3 namespace frith
5 #define LOGICAL_OPERATOR(name, operator) \
6 bool \
7 left_value, \
8 right_value; \
9 if(get_boolean_value(left_value) && argument.other.get_boolean_value(right_value)) \
10 { \
11 argument.output.new_boolean(left_value operator right_value); \
12 return true; \
13 } \
14 else \
15 { \
16 argument.error_message = get_unary_argument_type_error(name, type); \
17 return false; \
20 bool variable::logical_and(binary_argument & argument) const
22 LOGICAL_OPERATOR("Logical and", &&)
25 bool variable::logical_or(binary_argument & argument) const
27 LOGICAL_OPERATOR("Logical or", ||)