mirror of
https://github.com/boostorg/spirit.git
synced 2026-01-19 04:42:11 +00:00
Examples bug fixes and code tweaks to make g++ 4.2 happy.
[SVN r63729]
This commit is contained in:
@@ -6,7 +6,11 @@
|
||||
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#==============================================================================
|
||||
project spirit-karma-example
|
||||
: requirements <toolset>gcc:<c++-template-depth>300 : :
|
||||
: requirements
|
||||
<toolset>gcc:<c++-template-depth>300
|
||||
<toolset>darwin:<cxxflags>-ftemplate-depth-300
|
||||
:
|
||||
:
|
||||
;
|
||||
|
||||
exe actions_example : actions.cpp ;
|
||||
|
||||
@@ -5,8 +5,14 @@
|
||||
# Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#==============================================================================
|
||||
project spirit-lexer-example
|
||||
: requirements
|
||||
<toolset>gcc:<c++-template-depth>300
|
||||
<toolset>darwin:<cxxflags>-ftemplate-depth-300
|
||||
:
|
||||
:
|
||||
;
|
||||
|
||||
project spirit-lexer-example ;
|
||||
|
||||
exe example1 : example1.cpp ;
|
||||
exe example2 : example2.cpp ;
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#==============================================================================
|
||||
project spirit-qi-example
|
||||
: requirements <toolset>gcc:<c++-template-depth>300
|
||||
: requirements
|
||||
<toolset>gcc:<c++-template-depth>300
|
||||
<toolset>darwin:<cxxflags>-ftemplate-depth-300
|
||||
:
|
||||
:
|
||||
;
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace client
|
||||
namespace boost { namespace spirit { namespace traits
|
||||
{
|
||||
template <typename A, typename B>
|
||||
struct transform_attribute<client::data<A, B>, fusion::vector<A&, B&> >
|
||||
struct transform_attribute<client::data<A, B>, fusion::vector<A&, B&>, qi::domain>
|
||||
{
|
||||
typedef fusion::vector<A&, B&> type;
|
||||
|
||||
|
||||
@@ -38,13 +38,16 @@ statement<Iterator>::statement(std::vector<int>& code)
|
||||
lexeme
|
||||
[
|
||||
vars [_val = _1]
|
||||
>> !(alnum | '_') // make sure we have whole words
|
||||
>> !(alnum | '_') // make sure we have whole words
|
||||
]
|
||||
;
|
||||
|
||||
var_decl =
|
||||
"var"
|
||||
> !var_ref // make sure the variable isn't redeclared
|
||||
lexeme[
|
||||
"var"
|
||||
>> !(alnum | '_') // make sure we have whole words
|
||||
]
|
||||
> !var_ref // make sure the variable isn't redeclared
|
||||
> identifier [add_var(_1, ref(nvars))]
|
||||
> (';' | '=' > assignment_rhs(ref(nvars)-1))
|
||||
;
|
||||
|
||||
@@ -43,8 +43,11 @@ statement<Iterator>::statement(std::vector<int>& code)
|
||||
;
|
||||
|
||||
var_decl =
|
||||
"var"
|
||||
> !var_ref // make sure the variable isn't redeclared
|
||||
lexeme[
|
||||
"var"
|
||||
>> !(alnum | '_') // make sure we have whole words
|
||||
]
|
||||
> !var_ref // make sure the variable isn't redeclared
|
||||
> identifier [add_var(_1, ref(nvars))]
|
||||
> (';' | '=' > assignment_rhs(ref(nvars)-1))
|
||||
;
|
||||
|
||||
@@ -31,7 +31,7 @@ statement<Iterator>::statement(
|
||||
lexeme
|
||||
[
|
||||
vars [_val = _1]
|
||||
>> !(alnum | '_') // make sure we have whole words
|
||||
>> !(alnum | '_') // make sure we have whole words
|
||||
]
|
||||
;
|
||||
|
||||
@@ -40,7 +40,7 @@ statement<Iterator>::statement(
|
||||
"int"
|
||||
>> !(alnum | '_') // make sure we have whole words
|
||||
]
|
||||
> !var_ref // make sure the variable isn't redeclared
|
||||
> !var_ref // make sure the variable isn't redeclared
|
||||
> identifier [add_var(_1)]
|
||||
> (';' | '=' > assignment_rhs(ref(nvars)-1))
|
||||
;
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace boost { namespace spirit { namespace traits
|
||||
// a fusion sequence consisting out of three integers as its attribute.
|
||||
template<>
|
||||
struct transform_attribute<
|
||||
boost::gregorian::date, fusion::vector<int, int, int> >
|
||||
boost::gregorian::date, fusion::vector<int, int, int>, qi::domain>
|
||||
{
|
||||
typedef fusion::vector<int, int, int> date_parts;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user