Found a solution to the multi statement/non comma separated argument issue, I think
[fridhskrift.git] / variable / logical_operator.cpp
blobd68b0649f02b5ac34621899eb84a4995c63ccd18
1 #include <frith/symbol.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", ||)