Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59740 - trunk/boost/property_tree/detail
From: sebastian.redl_at_[hidden]
Date: 2010-02-17 14:26:53


Author: cornedbee
Date: 2010-02-17 14:26:52 EST (Wed, 17 Feb 2010)
New Revision: 59740
URL: http://svn.boost.org/trac/boost/changeset/59740

Log:
Make the JSON parser's number production fit the JSON spec instead of doing stupid things. Fixes bug 3831.
Text files modified:
   trunk/boost/property_tree/detail/json_parser_read.hpp | 8 ++++++--
   1 files changed, 6 insertions(+), 2 deletions(-)

Modified: trunk/boost/property_tree/detail/json_parser_read.hpp
==============================================================================
--- trunk/boost/property_tree/detail/json_parser_read.hpp (original)
+++ trunk/boost/property_tree/detail/json_parser_read.hpp 2010-02-17 14:26:52 EST (Wed, 17 Feb 2010)
@@ -231,8 +231,12 @@
                         ;
                 
                 number
- = strict_real_p
- | int_p
+ = !ch_p("-") >>
+ (ch_p("0") | (range_p(Ch('1'), Ch('9')) >> *digit_p)) >>
+ !(ch_p(".") >> +digit_p) >>
+ !(chset_p(detail::widen<Ch>("eE").c_str()) >>
+ !chset_p(detail::widen<Ch>("-+").c_str()) >>
+ +digit_p)
                         ;
                 
                 string


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk