-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Obtaining source positions #309
Comments
let input = position::Stream::new(input_str);
parser.parse(input) |
@Marwes I found the However, because you need to call
What I ended up doing was just writing my own This seems like it'd be good to add to the library, I'd gladly open a PR if you're interested. |
@Marwes |
Yes, that seems like a good addition. Never thought about |
@Gallagator If you want to use a specific type in the parser you need to specific it in the type signature (same thing that you did with
|
@Marwes Thanks a lot! I was very confused! |
How do you obtain source positions in combine?
I found the position combinator,
combine::combinator::position
, but that yields a position of type<I as combine::StreamOnce>::Position
. For example:It seems like this is the best way to get position information in the case of a successful parse (e.g. not an error case). How do you use this type? How do you extract a line number from it? A column number?
The text was updated successfully, but these errors were encountered: