Replies: 1 comment
-
Feel free to make an issue for improving this! As a workaround, you could
This will likely require dropping down to imperative code. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am having trouble tracking spans with
Located
and nested input.I have two parsers, an inner parser & outer parser.
I want to parse till the end of the line in the outer parser, then pass it to the inner parser.
First I call
winnow::ascii::till_line_ending
which is aimpl Parser<Located<&str>, &str, _>
To try to recover the input location i call
take
which is also animpl Parser<Located<&str>, &str, _>
But then I can't call
and_then(inner_parser)
because the inner parser expects location information that has been discarded.As far as I can tell, there is no way for me to "nest" the inner parser inside the outer parser without loosing location information.
The issue is that both
till_line_ending
andtake
produce<I as Stream>::Slice
while I want the original inputI
.Complete code & compiler errors are here: https://gist.github.com/Techcable/be3a473722bed761599d80186ba79f8f
For now I've worked around this by simply discarding span location.
However, that is obviously suboptimal.
Beta Was this translation helpful? Give feedback.
All reactions