Closed akrzemi1 closed 8 months ago
Remember the thing I said before on #50 (https://github.com/tzlaine/parser/issues/50#issuecomment-1879827991)? I think that applies to my example of parsing int
s, but far less so to parsing individual characters. Just like I have as special case for std::string
instead of std::vector<char>
in repeat parsers, I'm now considering a special case for char types in sequence parsers.
I have this in mind:
1) The example above would produce a std::string
.
2) Introduce separate[]
directive (which would apply only to sequence parsers) to disable combining, like how it would happen under 1), or in general, like it happens now for *int_ >> int_
.
3) Introduce merge[]
(also only for sequence parsers) that would make the int_ >> int_
attribute std::vector<int>
.
I'm still wrestling with the idea of including char32_t
-attribute parsers in 1) and in the current std::string
versus std::vector
rule. I'm leading toward inclusion; I think it's more natural not to have to worry about the distinction.
Boost.Spirit allowed the syntax for defining a parser that matched a token compliant with a simple pattern and had a `std::string as attribute:
Does Boost.Parser offer an equivalent?
Here is a full code that compiles in Boost.Spirit but not in Boost.Parser. You already said Boost.Parser will not provide an identical syntax, so I am asking for an alternative.