support hex (10x), oct (10o) and binary (10b) literals

This commit is contained in:
River Tarnell 2008-08-09 09:32:19 +00:00
parent 7bf795588e
commit d94fd3860b

View file

@ -255,6 +255,15 @@ struct parser_grammar : public grammar<parser_grammar, parser_closure::context_t
*/
value =
strict_real_p[value.val = bind(&datum::from_double)(arg1)]
#if 0
| oct_p[value.val = bind(f_from_str)(arg1, 8)] >> 'o'
| hex_p[value.val = bind(f_from_str)(arg1, 16)] >> 'x'
| bin_p[value.val = bind(f_from_str)(arg1, 2)] >> 'b'
| int_p[value.val = bind(&datum::from_int)(arg1)]
#endif
| oct_p[value.val = bind(&datum::from_int)(arg1)] >> 'o'
| hex_p[value.val = bind(&datum::from_int)(arg1)] >> 'x'
| bin_p[value.val = bind(&datum::from_int)(arg1)] >> 'b'
| int_p[value.val = bind(&datum::from_int)(arg1)]
| confix_p('"', *c_escape_ch_p, '"')[
value.val = bind(&datum::from_string)(construct_<std::string>(arg1 + 1, arg2 - 1))