|
Boost : |
From: Joel de Guzman (djowel_at_[hidden])
Date: 2003-03-24 06:58:16
Jon Wray wrote:
> Thanks! I noticed that this change leads to different behavior when
> assigning rules. Consider this code:
>
> typename rule_<ScannerT, IDENTIFIER>::type Identifier;
> typename rule_<ScannerT, FUNCTION>::type Function;
> typename rule_<ScannerT, PREDICATE>::type Predicate;
> typename rule_<ScannerT, VARIABLE>::type Variable;
>
> Identifier = lexeme_d[token_node_d[(alpha_p | '_' | '$') >>
> *(alnum_p
>> '_' | '$')]];
> Function = Identifier;
> Predicate = Identifier;
> Variable = Identifier;
>
> value.id().to_long() used to return FUNCTION, PREDICATE, or VARIABLE,
> but it now returns IDENTIFIER.
[snip]
Huh? AFAICT, Function.id() == FUNCTION, Predicate.id() == PREDICATE
and Variable.id() == VARIABLE.
I tested this...
rule<scanner<>, parser_context, parser_tag<1> > r1;
rule<scanner<>, parser_context, parser_tag<2> > r2;
r1 = r2;
assert(r1.id() == 1);
assert(r2.id() == 2);
What am I missing?
-- Joel de Guzman joel at boost-consulting.com http://www.boost-consulting.com http://spirit.sf.net
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk