diff --git a/src/diag.md b/src/diag.md index 3d9a6fc3..b30ec2ec 100644 --- a/src/diag.md +++ b/src/diag.md @@ -11,9 +11,9 @@ HIR and MIR, allowing for more informative error reporting. [span]: https://doc.rust-lang.org/nightly/nightly-rustc/syntax/source_map/struct.Span.html -A `Span` can be looked up in a [`SourceMap`][sourcemap] to get a "snippet" useful -for displaying errors with [`span_to_snippet`][sptosnip] and other similar -methods on the `SourceMap`. +A `Span` can be looked up in a [`SourceMap`][sourcemap] to get a "snippet" +useful for displaying errors with [`span_to_snippet`][sptosnip] and other +similar methods on the `SourceMap`. [sourcemap]: https://doc.rust-lang.org/nightly/nightly-rustc/syntax/source_map/struct.SourceMap.html [sptosnip]: https://doc.rust-lang.org/nightly/nightly-rustc/syntax/source_map/struct.SourceMap.html#method.span_to_snippet diff --git a/src/the-parser.md b/src/the-parser.md index 62b43c0e..ac902d91 100644 --- a/src/the-parser.md +++ b/src/the-parser.md @@ -23,9 +23,10 @@ The `syntax` crate contains several main players, nodes. The main entrypoint to the parser is via the various `parse_*` functions in the -[parser module]. They let you do things like turn a [`SourceFile`][sourcefile] (e.g. -the source in a single file) into a token stream, create a parser from the -token stream, and then execute the parser to get a `Crate` (the root AST node). +[parser module]. They let you do things like turn a [`SourceFile`][sourcefile] +(e.g. the source in a single file) into a token stream, create a parser from +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