From 82ac1bc0d2cca3b8dcfd0c92d343fbdae4a821a5 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Mon, 3 Aug 2020 10:14:27 +0900 Subject: [PATCH 1/2] Fix link/wording for `parse_nt` --- src/overview.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/overview.md b/src/overview.md index ec96d243f..9d8dfd908 100644 --- a/src/overview.md +++ b/src/overview.md @@ -42,7 +42,7 @@ we'll talk about that later. analysis. The crate entry points for the parser are the `Parser.parse_crate_mod()` and `Parser.parse_mod()` methods found in `librustc_parse::parser::item`. The external module parsing entry point is `librustc_expand::module::parse_external_mod`. And - the macro parser entry point is `rustc_expand::mbe::macro_parser::parse_nt`. + the macro parser entry point is [`Parser.parse_nonterminal()`][parse_nonterminal]. - Parsing is performed with a set of `Parser` utility methods including `fn bump`, `fn check`, `fn eat`, `fn expect`, `fn look_ahead`. - Parsing is organized by the semantic construct that is being parsed. Separate @@ -111,6 +111,7 @@ we'll talk about that later. [mir-opt]: https://rustc-dev-guide.rust-lang.org/mir/optimizations.html [`simplify_try`]: https://github.com/rust-lang/rust/pull/66282 [codegen]: https://rustc-dev-guide.rust-lang.org/backend/codegen.html +[parse_nonterminal]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_parse/parser/struct.Parser.html#method.parse_nonterminal ## How it does it @@ -347,7 +348,7 @@ For more details on bootstrapping, see - Main entry points: - [Entry point for first file in crate](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_interface/passes/fn.parse.html) - [Entry point for outline module parsing](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_expand/module/fn.parse_external_mod.html) - - [Entry point for macro fragments](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_expand/mbe/macro_parser/fn.parse_nt.html) + - [Entry point for macro fragments][parse_nonterminal] - AST definition: [`librustc_ast`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_ast/ast/index.html) - Expansion: **TODO** - Name Resolution: **TODO** From bbb27acb9779a92795364b9cd787f1712e2d3283 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Mon, 3 Aug 2020 11:53:26 +0900 Subject: [PATCH 2/2] Prefer `::` than `.` --- src/overview.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/overview.md b/src/overview.md index 9d8dfd908..e97fba6b9 100644 --- a/src/overview.md +++ b/src/overview.md @@ -38,11 +38,11 @@ we'll talk about that later. data which are emitted in `librustc_parse::lexer::mod` as real diagnostics. - The lexer preserves full fidelity information for both IDEs and proc macros. - The parser [translates the token stream from the lexer into an Abstract Syntax - Tree (AST)][parser]. It uses a recursive descent (top-down) approach to syntax - analysis. The crate entry points for the parser are the `Parser.parse_crate_mod()` and - `Parser.parse_mod()` methods found in `librustc_parse::parser::item`. The external + Tree (AST)][parser]. It uses a recursive descent (top-down) approach to syntax + analysis. The crate entry points for the parser are the `Parser::parse_crate_mod()` and + `Parser::parse_mod()` methods found in `librustc_parse::parser::item`. The external module parsing entry point is `librustc_expand::module::parse_external_mod`. And - the macro parser entry point is [`Parser.parse_nonterminal()`][parse_nonterminal]. + the macro parser entry point is [`Parser::parse_nonterminal()`][parse_nonterminal]. - Parsing is performed with a set of `Parser` utility methods including `fn bump`, `fn check`, `fn eat`, `fn expect`, `fn look_ahead`. - Parsing is organized by the semantic construct that is being parsed. Separate