|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r60340 - trunk/libs/spirit/example/qi/scheme
From: joel_at_[hidden]
Date: 2010-03-08 04:31:03
Author: djowel
Date: 2010-03-08 04:31:02 EST (Mon, 08 Mar 2010)
New Revision: 60340
URL: http://svn.boost.org/trac/boost/changeset/60340
Log:
changed symbol prefix from ';' to '\0' to avoid ambiguity
Text files modified:
trunk/libs/spirit/example/qi/scheme/sexpr.hpp | 3 ++-
trunk/libs/spirit/example/qi/scheme/simple_print.hpp | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
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 04:31:02 EST (Mon, 08 Mar 2010)
@@ -88,7 +88,8 @@
void operator()(std::string& utf8, uchar code_point) const
{
if (utf8.size() == 0)
- utf8 += ';'; // mark a symbol with prefix ';'
+ utf8 += '\0'; // mark a symbol with prefix 0
+ // (a 0 byte at the beginningsignifies a symbol)
push_utf8()(utf8, code_point);
}
};
Modified: trunk/libs/spirit/example/qi/scheme/simple_print.hpp
==============================================================================
--- trunk/libs/spirit/example/qi/scheme/simple_print.hpp (original)
+++ trunk/libs/spirit/example/qi/scheme/simple_print.hpp 2010-03-08 04:31:02 EST (Mon, 08 Mar 2010)
@@ -53,7 +53,7 @@
{
typedef typename Range::const_iterator iterator;
iterator i = range.begin();
- bool const is_symbol = *i == ';';
+ bool const is_symbol = *i == '\0'; // a 0 byte at the beginning signifies a symbol
if (!is_symbol)
print('"');
else
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