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

EBNF formatting #3999

Closed
jesse99 opened this issue Nov 18, 2012 · 1 comment
Closed

EBNF formatting #3999

jesse99 opened this issue Nov 18, 2012 · 1 comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@jesse99
Copy link
Contributor

jesse99 commented Nov 18, 2012

I find the EBNF rules in the manual rather hard to read. Here are a few problems:

  • Everything is space separated so there are no visual cues about what belongs with what. This is especially problematic with the * and ? meta-characters.
  • Single quotes are used for literal characters and double quotes for literal strings. There doesn't seem much point in this and using just single quotes would be less visually distracting.
  • It seems odd to use square brackets for grouping.
  • Some typographic conventions would be helpful. Maybe meta characters in bold.

For example compare:
vec_expr : '[' "mut" ? [ expr [ ',' expr ] + ] ? ']'

with:
vec_expr : '[' 'mut'? ( expr ( ',' expr ) + ) ? ']'

(Too many spaces in the above because markdown gets confused with series of asterisks).

@graydon
Copy link
Contributor

graydon commented May 15, 2013

We're going to be completely replacing the grammar rules with rules extracted from a machine-checked grammar. Likely they'll be in whatever format the machine-checking tool uses. Closing this as WONTFIX; we may revisit typographic issues when the grammar gets refreshed.

@graydon graydon closed this as completed May 15, 2013
flip1995 pushed a commit to flip1995/rust that referenced this issue Feb 10, 2022
Add lint `transmute_undefined_repr`

Partially implements rust-lang#3999 and rust-lang#546

This doesn't consider `enum`s at all right now as those are going to be a pain to deal with. This also allows `#[repr(Rust)]` structs with only one non-zero sized fields. I think those are technically undefined when transmuted.

changelog: Add lint `transmute_undefined_repr`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

2 participants