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

Merged
merged 1 commit into from
Apr 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/notation.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ When such a string in `monospace` font occurs inside the grammar,
it is an implicit reference to a single member of such a string table
production. See [tokens] for more information.

## Railroad visualizations
## Grammar visualizations

Below each grammar block is a button to toggle the display of a [railroad diagram]. A square element is a non-terminal rule, and a rounded rectangle is a terminal.
Below each grammar block is a button to toggle the display of a [syntax diagram]. A square element is a non-terminal rule, and a rounded rectangle is a terminal.

[railroad diagram]: https://en.wikipedia.org/wiki/Syntax_diagram
[syntax diagram]: https://en.wikipedia.org/wiki/Syntax_diagram

## Common productions

Expand Down
2 changes: 1 addition & 1 deletion theme/reference.css
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ main > .rule {

/* The toggle button. */
.grammar-toggle-railroad {
width: 120px;
width: 160px;
padding: 5px 0px;
border-radius: 5px;
cursor: pointer;
Expand Down
4 changes: 2 additions & 2 deletions theme/reference.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ function update_railroad() {
const buttons = document.querySelectorAll('.grammar-toggle-railroad');
buttons.forEach(button => {
if (grammarRailroad) {
button.innerText = "Hide Railroad";
button.innerText = "Hide syntax diagram";
} else {
button.innerText = "Show Railroad";
button.innerText = "Show syntax diagram";
}
});
}
Expand Down