5 ms·
Great write-up! (And great work). A little surprised there's no mention of looking at the implementation (src/grammar/parswr-larl.y, eg line 308) -- perhaps in
by e12e 12y ago
Great write-up! (And great work).
A little surprised there's no mention of looking at the implementation (src/grammar/parswr-larl.y, eg line 308) -- perhaps in the next installment?
- carols10cents 12y agoYeah, I was going to get into the implementation when I was going to figure out what `path` should be, which was also when I decided the post was getting too long ;) Note that src/grammar/parser-lalr.y is a reference grammar for testing [1] and the actual implementation is in src/libsyntax, afaik. [1] - https://github.com/rust-lang/rust/pull/21452 https://github.com/rust-lang/rust/pull/21452
- e12e 12y agoSo, there's three "official" grammars for Rust? The one in the documentation, the reference grammar (that serves as documentation and testing) - and the actual grammar, used in the reference implementation? No wonder there are inconsistencies... Sounds like paring it down to two: a reference/testing grammar that is well documented; perhaps written/maintained with a literate programming tool and the actual implementation is a good idea. Kill off the "only documentation" grammar and/or merge it with the larl-one.
- acqq 12y agoI was also wondering why not autogenerating a "documentation" grammar out of the working code.
- steveklabnik 12y agoThere were only three temporarily: today, the reference grammar is all gone, subsumed into the documentation/testing grammar.