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

Bison grammar is outdated #32723

Closed
pekabon opened this issue Apr 4, 2016 · 11 comments
Closed

Bison grammar is outdated #32723

pekabon opened this issue Apr 4, 2016 · 11 comments
Labels
A-grammar Area: The grammar of Rust C-bug Category: This is a bug.

Comments

@pekabon
Copy link

pekabon commented Apr 4, 2016

It looks like grammar (https://github.com/rust-lang/rust/tree/master/src/grammar) is outdated, for example '?' shortcut for try! is not supported.

@sanxiyn sanxiyn added the A-grammar Area: The grammar of Rust label Apr 4, 2016
@steveklabnik
Copy link
Member

Well, one question is, should the grammar show nightly-only things. If so, it would not include ?. That said, it's clearly not complete, if you look at all the A-grammar tags.

@nikomatsakis has been working on a larlpop grammar that would hopefully make this stuff easier...

@alexcrichton
Copy link
Member

cc #15880, a bot which is intended to run these tests

@Mark-Simulacrum
Copy link
Member

I don't think we have a bison grammar in-tree anymore... @nikomatsakis @steveklabnik @alexcrichton Do you know of the current state of the in-tree grammar? Do we want to show nightly-only things in the grammar?

@alexcrichton
Copy link
Member

Oh I have no idea what's up with the current in-tree grammar, I would expect it to be quite out of date at this point.

@steveklabnik
Copy link
Member

Yeah, it's basically abandonware. Niko had some efforts to have a real one, but I assume anything we do have is horribly bit-rotted.

@Mark-Simulacrum
Copy link
Member

Do we want to try and get some movement from the community on implementing a reference grammar? Is it something we're interested in maintaining? If not, we should probably go ahead and close out issues relevant to the reference grammar; if yes, arguably closing the issues in favor of a thread on internals would still be a good idea.

@steveklabnik
Copy link
Member

if yes, arguably closing the issues in favor of a thread on internals would still be a good idea.

I would go this route, but let's hear what @nikomatsakis has to say

@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 24, 2017
@chordowl
Copy link
Contributor

chordowl commented Aug 23, 2017

Traige: There is ongoing work (as of about two weeks ago) on creating an up-to-date grammar in the reference (rust-lang/reference#84); generally, this issue seems to under #30942 when it comes to a machine-readable grammar, and the reference issue when it comes to just having some up-to-date grammar.

kennytm added a commit to kennytm/rust that referenced this issue Oct 9, 2017
Update grammar to parse current rust syntax

Mainly addressing rust-lang#32723. This PR updates the bison grammar so that it can parse the current rust syntax, except for feature-gated syntax additions. It has been tested with all the tests in run-pass.

The grammar in this repo doesn't have build logic anymore, but you can test it out in https://github.com/bleibig/rust-grammar, which has all of what's in this PR. If you are interested in having build logic and grammar tests again, I can look into implementing that as well.

I'm aware that things are somewhat undecided as to what an official rust grammar should be from the discussion in rust-lang#30942. With this PR we can go back to having an up-to-date flex/bison based grammar, but the rustypop grammar looks interesting as well.
@steveklabnik
Copy link
Member

Triage: there's a new grammar wg, and i don't even think the bison grammar still exists. closing as outdated.

@tromey
Copy link
Contributor

tromey commented Oct 31, 2018

I still see src/grammar/parser-lalr.y in my tree - perhaps it should be removed?

@steveklabnik
Copy link
Member

After posting that comment, I checked it out again and saw that it was still there, which led to #55545

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-grammar Area: The grammar of Rust C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

7 participants