minor edits
This commit is contained in:
parent
dc74644c7d
commit
f92166e2b5
|
|
@ -1,19 +1,18 @@
|
||||||
# Syntax and the AST
|
# Syntax and the AST
|
||||||
|
|
||||||
Working directly with source code is very inconvenient and error-prone. Thus,
|
Working directly with source code is very inconvenient and error-prone.
|
||||||
before we do anything else, we convert raw source code into an [Abstract Syntax
|
Thus, before we do anything else, we convert raw source code into an
|
||||||
Tree (`AST`)][`AST`]. It turns out that doing even this involves a lot of work,
|
[Abstract Syntax Tree (AST)][AST]. It turns out that doing this involves a lot of work,
|
||||||
including [lexing, parsing], [`macro` expansion], [name resolution], conditional
|
including [lexing, parsing], [macro expansion], [name resolution], conditional
|
||||||
compilation, [feature-gate checking], and [validation] of the [`AST`]. In this chapter,
|
compilation, [feature-gate checking], and [validation] of the [AST].
|
||||||
we take a look at all of these steps.
|
In this chapter, we take a look at all of these steps.
|
||||||
|
|
||||||
Notably, there isn't always a clean ordering between these tasks. For example,
|
Notably, there isn't always a clean ordering between these tasks.
|
||||||
`macro` expansion relies on name resolution to resolve the names of `macro`s and
|
For example, macro expansion relies on name resolution to resolve the names of macros and imports.
|
||||||
imports. And parsing requires `macro` expansion, which in turn may require
|
And parsing requires macro expansion, which in turn may require parsing the output of the macro.
|
||||||
parsing the output of the `macro`.
|
|
||||||
|
|
||||||
[`AST`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_parse/index.html
|
[AST]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_parse/index.html
|
||||||
[`macro` expansion]: ./macro-expansion.md
|
[macro expansion]: ./macro-expansion.md
|
||||||
[feature-gate checking]: ./feature-gate-ck.md
|
[feature-gate checking]: ./feature-gate-ck.md
|
||||||
[lexing, parsing]: ./lexing-parsing.md
|
[lexing, parsing]: ./lexing-parsing.md
|
||||||
[name resolution]: ./name-resolution.md
|
[name resolution]: ./name-resolution.md
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue