x3 range char parser does not work.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

x3 range char parser does not work.

seaswar
Not clear what is wrong. Boost version is 1.59

spirit.cpp:
#include <iostream>
#include <string>
#include <boost/spirit/home/x3.hpp>

int main()
{
    namespace x3 = boost::spirit::x3;

    std::string input = "A";
    std::string::const_iterator p = input.begin();
    std::string::const_iterator e = input.end();
    if (x3::parse(p, e, x3::char_('A', 'F'))) { // this works -> x3::char_("ABCDEF")
        if (p == e)
            std::cout << "OK" << std::endl;
        else
            std::cout << "PARTIAL" << std::endl;
    }
    else
        std::cout << "FAILED" << std::endl;
}

$ g++ -std=c++14 -o spirit spirit.cpp
$./spirit
FAILED
$uname -a
Linux pangolin 4.2.0-21-generic #25-Ubuntu SMP Wed Dec 2 18:42:25 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux


Thanks
suresh


------------------------------------------------------------------------------

_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: x3 range char parser does not work.

sehe
On 28-12-15 20:27, Suresh Easwar wrote:

> #include <iostream>
> #include <string>
> #include <boost/spirit/home/x3.hpp>
>
> int main()
> {
>     namespace x3 = boost::spirit::x3;
>
>     std::string input = "A";
>     std::string::const_iterator p = input.begin();
>     std::string::const_iterator e = input.end();
>     if (x3::parse(p, e, x3::char_('A', 'F'))) { // this works ->
> x3::char_("ABCDEF")
>         if (p == e)
>             std::cout << "OK" << std::endl;
>         else
>             std::cout << "PARTIAL" << std::endl;
>     }
>     else
>         std::cout << "FAILED" << std::endl;
> }
I'm sure it's a known bug. It's working correctly with Boost 1.60.0

------------------------------------------------------------------------------
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: x3 range char parser does not work.

Joel de Guzman
On 12/29/15 6:37 AM, Seth wrote:

> On 28-12-15 20:27, Suresh Easwar wrote:
>> #include <iostream>
>> #include <string>
>> #include <boost/spirit/home/x3.hpp>
>>
>> int main()
>> {
>>      namespace x3 = boost::spirit::x3;
>>
>>      std::string input = "A";
>>      std::string::const_iterator p = input.begin();
>>      std::string::const_iterator e = input.end();
>>      if (x3::parse(p, e, x3::char_('A', 'F'))) { // this works ->
>> x3::char_("ABCDEF")
>>          if (p == e)
>>              std::cout << "OK" << std::endl;
>>          else
>>              std::cout << "PARTIAL" << std::endl;
>>      }
>>      else
>>          std::cout << "FAILED" << std::endl;
>> }
> I'm sure it's a known bug. It's working correctly with Boost 1.60.0

Works fine here (boost devel).

Regards,
--
Joel de Guzman
http://www.ciere.com
http://boost-spirit.com
http://www.cycfi.com/


------------------------------------------------------------------------------
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general