Re: Not able to use x3::skip(skipper)[some recursive rule] in its rule definition
Larry Evans <[email protected]>
| Newsgroups | gmane.comp.parsers.spirit.general |
|---|---|
| Message-ID | <[email protected]> |
On 07/28/2017 10:12 AM, Larry Evans wrote: > On 07/27/2017 02:48 AM, Larry Evans wrote: >> On 07/26/2017 08:37 AM, Larry Evans wrote: >>> On 07/25/2017 09:54 AM, Larry Evans wrote: >>>> On 07/25/2017 09:18 AM, Han Wang wrote: >>>>> Hi Larry, >>>>> >>>>> I think we cannot just change make_context to make_unique_context >>>>> here in x3::skip_directive. If there already is a skipper in the >>>>> context (x3::space e.g), the new skipper (ruleComment) will be >>>>> ignored (because x3::make_unique_context will simply return the >>>>> original context). >>>>> [snip] > I've no idea, yet, how to solve this problem. Also, I've not > made a test case either so I may be completely wrong. > > I hope someone else will solve problem. > Someone else has: https://github.com/boostorg/spirit/pull/237 However, I'm not sure that's the best solution. A better one might be storing the skipper in the Iterator arg to the parse function and also aggregating both the Iterator's into something akin to boost's iterator_range. A prototype of such a solution is here: https://github.com/cppljevans/spirit/blob/get_rhs/workbench/x3/HanWang_make_context/y3-scanner.hpp Of course this would be a breaking changes, so it would have to be sometime in the far (1-5yr) future :( Thoughts? -regards, Larry BTW, I did try to post this suggestion to spirit-dev on 9/24, but it hasn't shown up yet :( ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Spirit-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/spirit-general