]>
Commit | Line | Data |
---|---|---|
ba9703b0 XL |
1 | # Syntax and the AST |
2 | ||
3 | 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. | |
6a06907d XL |
9 | |
10 | 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. |