diff options
Diffstat (limited to 'src/doc/rustc-dev-guide/src/syntax-intro.md')
-rw-r--r-- | src/doc/rustc-dev-guide/src/syntax-intro.md | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/doc/rustc-dev-guide/src/syntax-intro.md b/src/doc/rustc-dev-guide/src/syntax-intro.md new file mode 100644 index 000000000..43ef44577 --- /dev/null +++ b/src/doc/rustc-dev-guide/src/syntax-intro.md @@ -0,0 +1,13 @@ +# Syntax and the AST + +Working directly with source code is very inconvenient and error-prone. Thus, +before we do anything else, we convert raw source code into an AST. It turns +out that doing even this involves a lot of work, including lexing, parsing, +macro expansion, name resolution, conditional compilation, feature-gate +checking, and validation of the AST. 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, +macro expansion relies on name resolution to resolve the names of macros and +imports. And parsing requires macro expansion, which in turn may require +parsing the output of the macro. |