I'm trying to port a parser from Spirit V2 to X3. The overall experience is quite good but there are two problems.
The first one is that local variables are gone, which is quite inconvenient to me since I used them quite often to keep track of things. Hence I'm asking for something that would do the job of locals in V2.
The other one is best illustrated with this dummy example: I want to parse a comma separated list of integers into a vector<int>
, but it should only parse when the list sums up to zero:
auto const int_list = rule<class int_list, vector<int>>("int_list")
= int_ % ','
>> eps(/* How to extract the attribute? */);
I'm stuck with the last checking here as I don't know how to get my hands on the vector<int>
the rule is synthesizing.