Skip to content

Relabel grammarRailroad-Button #1798

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lukaslueg
Copy link

I suggest to relabel the button, and use the term "syntax diagram" instead of "railroad". The term "railroad" has no meaning to most readers.


On a different topic: Some of the diagrams can be simplified quite a bit. See the example below, which somewhat makes the written grammar more compact, but is to the benefit of the visual representation. Would you like a PR?

diff --git a/src/visibility-and-privacy.md b/src/visibility-and-privacy.md
index 847d469..e5469be 100644
--- a/src/visibility-and-privacy.md
+++ b/src/visibility-and-privacy.md
@@ -4,11 +4,7 @@ r[vis]
 r[vis.syntax]
 ```grammar,items
 Visibility ->
-      `pub`
-    | `pub` `(` `crate` `)`
-    | `pub` `(` `self` `)`
-    | `pub` `(` `super` `)`
-    | `pub` `(` `in` SimplePath `)`
+      `pub` ( `(` (`crate` | `self` | `super` | (`in` SimplePath))  `)` )?
a b

@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Apr 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: The marked PR is awaiting review from a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants