r38986 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r38985‎ | r38986 | r38987 >
Date:09:59, 9 August 2008
Author:river
Status:old
Tags:
Comment:
- match value before variable, otherwise FFFF is matched as a variable and a parse error occurs
- support uppercase X, O, B for base indicators
Modified paths:
  • /trunk/extensions/AbuseFilter/parser_native/parser.cpp (modified) (history)

Diff [purge]

Index: trunk/extensions/AbuseFilter/parser_native/parser.cpp
@@ -255,16 +255,12 @@
256256 */
257257 value =
258258 strict_real_p[value.val = bind(&datum::from_double)(arg1)]
259 -#if 0
260 - | oct_p[value.val = bind(f_from_str)(arg1, 8)] >> 'o'
261 - | hex_p[value.val = bind(f_from_str)(arg1, 16)] >> 'x'
262 - | bin_p[value.val = bind(f_from_str)(arg1, 2)] >> 'b'
263 - | int_p[value.val = bind(&datum::from_int)(arg1)]
264 -#endif
265 - | oct_p[value.val = bind(&datum::from_int)(arg1)] >> 'o'
266 - | hex_p[value.val = bind(&datum::from_int)(arg1)] >> 'x'
267 - | bin_p[value.val = bind(&datum::from_int)(arg1)] >> 'b'
268 - | int_p[value.val = bind(&datum::from_int)(arg1)]
 259+ | as_lower_d[
 260+ oct_p[value.val = bind(&datum::from_int)(arg1)] >> 'o'
 261+ | hex_p[value.val = bind(&datum::from_int)(arg1)] >> 'x'
 262+ | bin_p[value.val = bind(&datum::from_int)(arg1)] >> 'b'
 263+ | int_p[value.val = bind(&datum::from_int)(arg1)]
 264+ ]
269265 | confix_p('"', *c_escape_ch_p, '"')[
270266 value.val = bind(&datum::from_string)(construct_<std::string>(arg1 + 1, arg2 - 1))
271267 ]
@@ -304,9 +300,9 @@
305301 | ch_p('!') >> tern_expr[basic.val = !arg1]
306302 | ch_p('+') >> tern_expr[basic.val = arg1]
307303 | ch_p('-') >> tern_expr[basic.val = -arg1]
 304+ | value[basic.val = arg1]
308305 | variable[basic.val = arg1]
309306 | function[basic.val = arg1]
310 - | value[basic.val = arg1]
311307 ;
312308
313309 /*

Status & tagging log