Skip to content
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

Raw line number #69

Closed
Yamakaky opened this issue Oct 22, 2016 · 4 comments
Closed

Raw line number #69

Yamakaky opened this issue Oct 22, 2016 · 4 comments

Comments

@Yamakaky
Copy link

Yamakaky commented Oct 22, 2016

Using the last example from https://docs.rs/combine/2.0.0/combine/,

fn main() {
    if let Err(e) = parser(expr).parse("[") {
        println!("{}", e);
    }
}

outputs

Parse error at 94334017221597
Unexpected end of input
Expected ]

instead of the beautiful line: 1, column: 1 I was promised XD

@Marwes
Copy link
Owner

Marwes commented Oct 22, 2016

Oops, that has changed to require an explicit State::new

fn main() {
    if let Err(e) = parser(expr).parse(State::new("[")) {
        println!("{}", e);
    }
}

@Marwes
Copy link
Owner

Marwes commented Oct 22, 2016

With 2.0 I removed the implicit line + column tracking from parsing &str so to regain that behaviour one needs to explicitly wrap the input with State to get the old behaviour.

@Yamakaky
Copy link
Author

Yamakaky commented Oct 22, 2016

Ok, cool! Just update the example ;)
BTW, love your error reporting, so much better than nom's one

@Marwes
Copy link
Owner

Marwes commented Oct 22, 2016

Fixed in efa2eb1 (guess it won't show up on docs.rs until I upload a new version though). Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants