-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
X3: Recursive grammar: alternative container parses substitution issue #461
Labels
Comments
Xeverous
changed the title
recursive grammar with attribute
recursive grammar with (vector_attribute | x3::attr(vector{}))
Feb 13, 2019
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I rechecked your example and found that I was wrong, I am sorry. Please provide MWE next time. #include <boost/spirit/home/x3.hpp>
#include <boost/fusion/include/adapt_struct.hpp>
#include <vector>
namespace x3 = boost::spirit::x3;
struct Foo
{
int value;
std::vector<Foo> children;
};
BOOST_FUSION_ADAPT_STRUCT(Foo,
value, children)
x3::rule<class foo_r, Foo> foo;
auto const foo_def = x3::int_ >> ('{' >> *foo >> '}' | '[' >> *foo >> ']');
BOOST_SPIRIT_DEFINE(foo)
BOOST_SPIRIT_INSTANTIATE(decltype(foo), char const*, x3::unused_type) |
Kojoley
changed the title
recursive grammar with (vector_attribute | x3::attr(vector{}))
X3: Recursive grammar: alternative container parses substitution issue
Feb 14, 2019
i want to work on this issue please guide me |
For some reason, the specialization spirit/include/boost/spirit/home/x3/support/traits/is_substitute.hpp Lines 51 to 60 in b4c5ef7
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would like to parse such text:
With comment enabled, every config param must have empty
{}
after it's value. I tried to remove this requirement by providing alternative that results in the same attribute (empty vector of childs). However, if you uncomment code, it does not compile.Is this the same bug as #434 ? Any workaround?
The text was updated successfully, but these errors were encountered: