Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r61342 - trunk/libs/spirit/example/scheme/input
From: joel_at_[hidden]
Date: 2010-04-17 12:08:34


Author: djowel
Date: 2010-04-17 12:08:33 EDT (Sat, 17 Apr 2010)
New Revision: 61342
URL: http://svn.boost.org/trac/boost/changeset/61342

Log:
incorporated error handling and added error reporting tests.
Text files modified:
   trunk/libs/spirit/example/scheme/input/sexpr.hpp | 9 ++++++---
   1 files changed, 6 insertions(+), 3 deletions(-)

Modified: trunk/libs/spirit/example/scheme/input/sexpr.hpp
==============================================================================
--- trunk/libs/spirit/example/scheme/input/sexpr.hpp (original)
+++ trunk/libs/spirit/example/scheme/input/sexpr.hpp 2010-04-17 12:08:33 EDT (Sat, 17 Apr 2010)
@@ -72,9 +72,10 @@
             real_parser<double, strict_real_policies<double> > strict_double;
             uint_parser<unsigned char, 16, 2, 2> hex2;
 
- start = atom | list;
+ start = element.alias();
+ element = atom | list;
 
- list = '(' > *start > ')';
+ list = '(' > *element > ')';
 
             atom = strict_double
                     | integer
@@ -95,6 +96,7 @@
             byte_str = lexeme[no_case['b'] > +hex2];
 
             start.name("sexpr");
+ start.name("sexpr");
             list.name("list");
             atom.name("atom");
             symbol.name("symbol");
@@ -103,7 +105,8 @@
             on_error<fail>(start, error_handler(_1, _2, _3, _4));
         }
 
- rule<Iterator, sexpr_white_space<Iterator>, utree()> start, list;
+ rule<Iterator, sexpr_white_space<Iterator>, utree()>
+ start, list, element;
         rule<Iterator, int()> integer;
         rule<Iterator, utree()> atom;
         rule<Iterator, utf8_symbol()> symbol;


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