]> git.proxmox.com Git - rustc.git/blame - src/doc/rustc-dev-guide/src/syntax-intro.md
Merge tag 'debian/1.52.1+dfsg1-1_exp2' into proxmox/buster
[rustc.git] / src / doc / rustc-dev-guide / src / syntax-intro.md
CommitLineData
ba9703b0
XL
1# Syntax and the AST
2
3Working directly with source code is very inconvenient and error-prone. Thus,
4before we do anything else, we convert raw source code into an AST. It turns
5out that doing even this involves a lot of work, including lexing, parsing,
6macro expansion, name resolution, conditional compilation, feature-gate
7checking, and validation of the AST. In this chapter, we take a look at all
8of these steps.
6a06907d
XL
9
10Notably, there isn't always a clean ordering between these tasks. For example,
11macro expansion relies on name resolution to resolve the names of macros and
12imports. And parsing requires macro expansion, which in turn may require
13parsing the output of the macro.