@@ -35,9 +35,10 @@ The main entrypoint to the parser is via the various `parse_*` functions and oth
35
35
the token stream, and then execute the parser to get a ` Crate ` (the root AST
36
36
node).
37
37
38
- To minimise the amount of copying that is done, both the ` StringReader ` and
39
- ` Parser ` have lifetimes which bind them to the parent ` ParseSess ` . This contains
40
- all the information needed while parsing, as well as the ` SourceMap ` itself.
38
+ To minimise the amount of copying that is done,
39
+ both [ ` StringReader ` ] and [ ` Parser ` ] have lifetimes which bind them to the parent ` ParseSess ` .
40
+ This contains all the information needed while parsing,
41
+ as well as the [ ` SourceMap ` ] itself.
41
42
42
43
Note that while parsing, we may encounter macro definitions or invocations. We
43
44
set these aside to be expanded (see [ this chapter] ( ./macro-expansion.md ) ).
@@ -52,9 +53,9 @@ Code for lexical analysis is split between two crates:
52
53
constituting tokens. Although it is popular to implement lexers as generated
53
54
finite state machines, the lexer in ` rustc_lexer ` is hand-written.
54
55
55
- - [ ` StringReader ` ] from [ ` rustc_ast ` ] [ rustc_ast ] integrates ` rustc_lexer ` with ` rustc `
56
- specific data structures. Specifically, it adds ` Span ` information to tokens
57
- returned by ` rustc_lexer ` and interns identifiers.
56
+ - [ ` StringReader ` ] integrates ` rustc_lexer ` with data structures specific to ` rustc ` .
57
+ Specifically,
58
+ it adds ` Span ` information to tokens returned by ` rustc_lexer ` and interns identifiers.
58
59
59
60
[ rustc_ast ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_ast/index.html
60
61
[ rustc_errors ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_errors/index.html
0 commit comments