|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r60344 - trunk/libs/spirit/example/qi/scheme
From: joel_at_[hidden]
Date: 2010-03-08 07:43:27
Author: djowel
Date: 2010-03-08 07:43:26 EST (Mon, 08 Mar 2010)
New Revision: 60344
URL: http://svn.boost.org/trac/boost/changeset/60344
Log:
tweaks. caught a unicode lowercase table lookup bug
Text files modified:
trunk/libs/spirit/example/qi/scheme/out.txt | 2 +-
trunk/libs/spirit/example/qi/scheme/sexpr.hpp | 33 +++++++--------------------------
trunk/libs/spirit/example/qi/scheme/sexpr_test.txt | 3 ++-
3 files changed, 10 insertions(+), 28 deletions(-)
Modified: trunk/libs/spirit/example/qi/scheme/out.txt
==============================================================================
--- trunk/libs/spirit/example/qi/scheme/out.txt (original)
+++ trunk/libs/spirit/example/qi/scheme/out.txt 2010-03-08 07:43:26 EST (Mon, 08 Mar 2010)
@@ -1,2 +1,2 @@
-success: (123.45 true false 987 "this is a ⬠string" "Τη γλÏÏÏα μοÏ
ÎδÏÏαν ελληνική" (92 ("another string" apple Sîne)))
+success: (123.45 true false 255 63 "this is a ⬠string" "Τη γλÏÏÏα μοÏ
ÎδÏÏαν ελληνική" (92 ("another string" apple Sîne)))
Modified: trunk/libs/spirit/example/qi/scheme/sexpr.hpp
==============================================================================
--- trunk/libs/spirit/example/qi/scheme/sexpr.hpp (original)
+++ trunk/libs/spirit/example/qi/scheme/sexpr.hpp 2010-03-08 07:43:26 EST (Mon, 08 Mar 2010)
@@ -57,9 +57,6 @@
space // tab/space/cr/lf
| ';' >> *(char_ - eol) >> eol // comments
;
-
- //~ start.name("white_space");
- //~ debug(start);
}
rule<Iterator, unicode> start;
@@ -137,11 +134,6 @@
>> *(str_esc(_val) | (char_ - '"') [push_utf8(_val, _1)])
>> '"'
;
-
- //~ start.name("string");
- //~ str_esc.name("str_esc");
- //~ debug(start);
- //~ debug(str_esc);
}
rule<Iterator, unicode, void(std::string&)> str_esc;
@@ -160,32 +152,21 @@
list = '(' >> *start >> ')';
- atom = number [_val = _1]
- | lit("true") [_val = true]
- | lit("false") [_val = false]
- | string [_val = _1]
- | symbol [_val = _1]
+ atom = number [_val = _1]
+ | lit("true") [_val = true]
+ | lit("false") [_val = false]
+ | string [_val = _1]
+ | symbol [_val = _1]
;
char const* exclude = " ();\"\n\r\t";
symbol = +lexeme[print - char_(exclude)] [push_symbol_utf8(_val, _1)];
number = strict_double [_val = _1]
+ | lexeme[no_case["0x"] >> hex] [_val = _1]
+ | lexeme['0' >> oct] [_val = _1]
| int_ [_val = _1]
- | no_case["0x"] >> hex [_val = _1]
- | '0' >> oct [_val = _1]
;
-
- //~ start.name("sexpr");
- //~ list.name("list");
- //~ atom.name("atom");
- //~ symbol.name("symbol");
- //~ number.name("number");
- //~ debug(start);
- //~ debug(list);
- //~ debug(atom);
- //~ debug(symbol);
- //~ debug(number);
}
rule<Iterator, unicode, white_space<Iterator>, utree()> start, list;
Modified: trunk/libs/spirit/example/qi/scheme/sexpr_test.txt
==============================================================================
--- trunk/libs/spirit/example/qi/scheme/sexpr_test.txt (original)
+++ trunk/libs/spirit/example/qi/scheme/sexpr_test.txt 2010-03-08 07:43:26 EST (Mon, 08 Mar 2010)
@@ -2,7 +2,8 @@
123.45
true
false
- 987
+ 0xFF
+ 077
"this is a \u20AC string" ; A UTF-8 string
"Τη γλÏÏÏα μοÏ
ÎδÏÏαν ελληνική" ; Another UTF-8 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