Re: [Boost-users] [spirit] trouble using parse function with rules
Sorry, fat-fingered things and the message was sent too early. trying again:
Hi all,
I am new to spirit, and my only source of information has been the
current spirit documentation. I am running into a curious problem in
which the manual suggests some code should compile, yet it does not.
Test case:
----------------------------------------------------------------------------------------------
#include
Gabriel Redner wrote:
Sorry, fat-fingered things and the message was sent too early. trying again:
Hi all,
I am new to spirit, and my only source of information has been the current spirit documentation. I am running into a curious problem in which the manual suggests some code should compile, yet it does not. Test case:
---------------------------------------------------------------------------------------------- #include
using namespace boost::spirit; int main() { const char *s = "(1)"; rule<> r = ch_p('(') >> int_p >> ch_p(')');
parse(s, r); // compiles OK parse(s, r, space_p); // does NOT compile parse(s, ch_p('(') >> int_p >> ch_p(')'), space_p); // compiles OK } ----------------------------------------------------------------------------------------------
Why does the third parse() compile, but not the second? Does the rule require some kind of adaptor to work in this context?
See FAQ no 1 "The Scanner Business". Oh, BTW, the spirit mailing list is the proper venue for spirit related questions: http://boost.org/more/mailing_lists.htm#spirit Regards, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net
participants (2)
-
Gabriel Redner
-
Joel de Guzman