From f64d91211fdf483bd199448e8baa272381ead48e Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Fri, 13 Feb 2015 18:00:00 -0500 Subject: [PATCH 1/3] Generate grammar.html and link to it from the reference. Fixes #19278 --- mk/docs.mk | 2 +- src/doc/reference.md | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mk/docs.mk b/mk/docs.mk index 2a5a847d2a425..4c2c1243c65a4 100644 --- a/mk/docs.mk +++ b/mk/docs.mk @@ -27,7 +27,7 @@ ###################################################################### DOCS := index intro tutorial complement-bugreport \ complement-lang-faq complement-design-faq complement-project-faq \ - rustdoc reference + rustdoc reference grammar # Legacy guides, preserved for a while to reduce the number of 404s DOCS += guide-crates guide-error-handling guide-ffi guide-macros guide \ diff --git a/src/doc/reference.md b/src/doc/reference.md index 9c51f6bad6fee..c0af6affe8fa6 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -5,9 +5,7 @@ This document is the primary reference for the Rust programming language. It provides three kinds of material: - - Chapters that formally define the language grammar and, for each - construct, informally describe its semantics and give examples of its - use. + - Chapters that informally describe each language construct and their use. - Chapters that informally describe the memory model, concurrency model, runtime services, linkage model and debugging facilities. - Appendix chapters providing rationale and references to languages that @@ -23,8 +21,11 @@ separately by extracting documentation attributes from their source code. Many of the features that one might expect to be language features are library features in Rust, so what you're looking for may be there, not here. +You may also be interested in the [grammar]. + [book]: book/index.html [standard]: std/index.html +[grammar]: grammar.html # Notation From 1a99315c512cc5bd95e15705b2f34a815f1e882e Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Sat, 14 Feb 2015 20:50:08 -0500 Subject: [PATCH 2/3] Fix issue with generation --- src/doc/grammar.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/doc/grammar.md b/src/doc/grammar.md index b4e023c203911..9124328b8eee9 100644 --- a/src/doc/grammar.md +++ b/src/doc/grammar.md @@ -1,6 +1,4 @@ -# **This is a work in progress** - -% The Rust Grammar +% Grammar # Introduction From 2dd0a1e8c7b8028711e12cebe5f00f722b87beed Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Sun, 15 Feb 2015 11:49:20 -0500 Subject: [PATCH 3/3] Make tests pass --- src/doc/grammar.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/grammar.md b/src/doc/grammar.md index 9124328b8eee9..d7a29ea530952 100644 --- a/src/doc/grammar.md +++ b/src/doc/grammar.md @@ -568,7 +568,7 @@ binop_expr : expr binop expr ; The precedence of Rust binary operators is ordered as follows, going from strong to weak: -``` +```text * / % as + -