Index: trunk/extensions/AbuseFilter/parser_native/aftypes.cpp |
— | — | @@ -361,6 +361,14 @@ |
362 | 362 | } |
363 | 363 | |
364 | 364 | bool |
| 365 | +AFPData::compare_with_type(AFPData const &other) const { |
| 366 | + if (value_.which() != other.value_.which()) |
| 367 | + return false; |
| 368 | + |
| 369 | + return boost::apply_visitor(compare_visitor<std::equal_to>(), value_, other.value_); |
| 370 | +} |
| 371 | + |
| 372 | +bool |
365 | 373 | AFPData::less_than(AFPData const &other) const { |
366 | 374 | return boost::apply_visitor(arith_compare_visitor<std::less>(), value_, other.value_); |
367 | 375 | } |
Index: trunk/extensions/AbuseFilter/parser_native/makefile |
— | — | @@ -3,7 +3,7 @@ |
4 | 4 | CPPFLAGS = $(EXTRA_CPPFLAGS) |
5 | 5 | LDFLAGS = $(EXTRA_LDFLAGS) |
6 | 6 | |
7 | | -LIBS = -lboost_regex$(BOOST_TAG) -licuuc -licui18n -licudata -licui18n |
| 7 | +LIBS = -lboost_regex$(BOOST_TAG) -licuuc -licui18n -licudata |
8 | 8 | |
9 | 9 | expr: CPPFLAGS+=-DTEST_PARSER |
10 | 10 | |
Index: trunk/extensions/AbuseFilter/parser_native/parser.cpp |
— | — | @@ -111,6 +111,7 @@ |
112 | 112 | /* a sequence of uppercase letters is a variable */ |
113 | 113 | variable = |
114 | 114 | self.variables[variable.val = arg1] |
| 115 | + | (+upper_p)[variable.val = ""] |
115 | 116 | ; |
116 | 117 | |
117 | 118 | /* func(value) */ |
— | — | @@ -171,8 +172,10 @@ |
172 | 173 | >> *( |
173 | 174 | "==" >> eq_expr[eq2_expr.val = eq2_expr.val == arg1] |
174 | 175 | | "!=" >> eq_expr[eq2_expr.val = eq2_expr.val != arg1] |
175 | | - | "===" >> eq_expr[eq2_expr.val = eq2_expr.val == arg1] |
176 | | - | "!==" >> eq_expr[eq2_expr.val = eq2_expr.val != arg1] |
| 176 | + | "===" >> eq_expr[eq2_expr.val = |
| 177 | + bind(&AFPData::compare_with_type)(eq2_expr.val, arg1)] |
| 178 | + | "!==" >> eq_expr[eq2_expr.val = |
| 179 | + !bind(&AFPData::compare_with_type)(eq2_expr.val, arg1)] |
177 | 180 | ) |
178 | 181 | ; |
179 | 182 | |