Skip to content

Commit cba023d

Browse files
TbkhiNoratrieb
authored andcommitted
Update syntax-intro.md
1 parent 91d6ab9 commit cba023d

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

src/syntax-intro.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
# Syntax and the AST
22

33
Working directly with source code is very inconvenient and error-prone. Thus,
4-
before we do anything else, we convert raw source code into an AST. It turns
5-
out that doing even this involves a lot of work, including lexing, parsing,
6-
macro expansion, name resolution, conditional compilation, feature-gate
7-
checking, and validation of the AST. In this chapter, we take a look at all
8-
of these steps.
4+
before we do anything else, we convert raw source code into an [Abstract Syntax
5+
Tree (`AST`)][`AST`]. It turns out that doing even this involves a lot of work,
6+
including [lexing, parsing], [`macro` expansion], [name resolution], conditional
7+
compilation, [feature-gate checking], and [validation] of the [`AST`]. In this chapter,
8+
we take a look at all of these steps.
99

1010
Notably, there isn't always a clean ordering between these tasks. For example,
11-
macro expansion relies on name resolution to resolve the names of macros and
12-
imports. And parsing requires macro expansion, which in turn may require
13-
parsing the output of the macro.
11+
`macro` expansion relies on name resolution to resolve the names of `macro`s and
12+
imports. And parsing requires `macro` expansion, which in turn may require
13+
parsing the output of the `macro`.
14+
15+
[`AST`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_parse/index.html
16+
[`macro` expansion]: ./macro-expansion.md
17+
[feature-gate checking]: ./feature-gate-ck.md
18+
[lexing, parsing]: ./lexing-parsing.md
19+
[name resolution]: ./name-resolution.md
20+
[validation]: ./ast-validation.md

0 commit comments

Comments
 (0)