Skip to content

Confusing parser error #2191

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

Closed
brson opened this issue Apr 12, 2012 · 2 comments
Closed

Confusing parser error #2191

brson opened this issue Apr 12, 2012 · 2 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-parser Area: The lexing & parsing of Rust source code to an AST

Comments

@brson
Copy link
Contributor

brson commented Apr 12, 2012

enum Command = {
    name: option(Ident),
    op: Op
};
./dbl.rs:15:16: 15:17 error: expecting ',' but found '('
./dbl.rs:15     name: option(Ident),
                            ^

The errors says it was looking for a comma where the open paren is. I stared at at this for a long time wondering why it thought there should be a comma there. Eventually I realized that, even though it 'expected' a comma, there were other possible characters that it would have been happy with as well - in this case <.

@kud1ing
Copy link

kud1ing commented Apr 12, 2012

Also, backticks should be used.

@catamorphism
Copy link
Contributor

Reproduced with 3d43af1, but it involves deprecated syntax so I'm going to guess that this should be considered "obsolete". Reopen if I'm wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-parser Area: The lexing & parsing of Rust source code to an AST
Projects
None yet
Development

No branches or pull requests

3 participants