From f08eb5d654103c196ec0d97f4de3637c5d8fabbb Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo <tshepang@gmail.com> Date: Wed, 17 Aug 2022 07:04:29 +0200 Subject: [PATCH 1/2] remove incorrect info Closes #1433 --- src/the-parser.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/the-parser.md b/src/the-parser.md index 3482d2d75..d37a8dbf4 100644 --- a/src/the-parser.md +++ b/src/the-parser.md @@ -52,9 +52,9 @@ Code for lexical analysis is split between two crates: constituting tokens. Although it is popular to implement lexers as generated finite state machines, the lexer in `rustc_lexer` is hand-written. -- [`StringReader`] from [`rustc_ast`][rustc_ast] integrates `rustc_lexer` with `rustc` - specific data structures. Specifically, it adds `Span` information to tokens - returned by `rustc_lexer` and interns identifiers. +- [`StringReader`] integrates `rustc_lexer` with data structures specific to `rustc`. + Specifically, + it adds `Span` information to tokens returned by `rustc_lexer` and interns identifiers. [rustc_ast]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_ast/index.html [rustc_errors]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_errors/index.html From 0d35992536e0638b6cf6cbbfbe5ee114cfb67304 Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo <tshepang@gmail.com> Date: Wed, 17 Aug 2022 07:09:09 +0200 Subject: [PATCH 2/2] reformat, fix, and use unused links --- src/the-parser.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/the-parser.md b/src/the-parser.md index d37a8dbf4..cd8284ff2 100644 --- a/src/the-parser.md +++ b/src/the-parser.md @@ -35,9 +35,10 @@ The main entrypoint to the parser is via the various `parse_*` functions and oth the token stream, and then execute the parser to get a `Crate` (the root AST node). -To minimise the amount of copying that is done, both the `StringReader` and -`Parser` have lifetimes which bind them to the parent `ParseSess`. This contains -all the information needed while parsing, as well as the `SourceMap` itself. +To minimise the amount of copying that is done, +both [`StringReader`] and [`Parser`] have lifetimes which bind them to the parent `ParseSess`. +This contains all the information needed while parsing, +as well as the [`SourceMap`] itself. Note that while parsing, we may encounter macro definitions or invocations. We set these aside to be expanded (see [this chapter](./macro-expansion.md)).