Replies: 1 comment
-
This isn't possible using the existing combinators and I don't want to complicate them as much, as I think it is a somewhat niche feature, and if I start adding that, you might also want to parse something between n-m times but only if X is not parsed, etc. If you don't want to do validation afterwards, which I would really recommend - it is a semantic error, not a parse error, and if the parser accepts as much as possible, you can do better error messages during semantic validation, you can use a |
Beta Was this translation helpful? Give feedback.
-
Hello,
First of all, congratulation for the amazing job done. I am evaluating if I could change a big giant parser from boost spirit to lexy. My first finding are promising ( particularly build time, and much easier error compilation messages + very nice trace feature which really help to understand what's happen behind the hood).
Now; i have some stuff where I have not found solution/answer so far; here is a first one
From the documentation , i am trying to solve the case where for example 'b' is mandatory; 'a' and 'c' optional.
struct production { static constexpr auto rule = dsl::partial_combination(dsl::lit_c<'a'>, dsl::lit_c<'b'>, dsl::lit_c<'c'>); };
is is possible ? post checking after parsing can be undesirable , for multiple reason :
Beta Was this translation helpful? Give feedback.
All reactions