diff options
| author | Mark Mansi <markm@cs.wisc.edu> | 2018-01-29 11:50:34 -0600 |
|---|---|---|
| committer | Mark Mansi <markm@cs.wisc.edu> | 2018-01-29 11:50:34 -0600 |
| commit | 767893f428638c5401ac0dda32aa8f3af04509cd (patch) | |
| tree | 8f113d6c56445bf03b1da05a8224ab2dbb39af7b /src/doc/rustc-dev-guide | |
| parent | 5c2cc06d50a361afb449b387852342b224e2742f (diff) | |
| download | rust-767893f428638c5401ac0dda32aa8f3af04509cd.tar.gz rust-767893f428638c5401ac0dda32aa8f3af04509cd.zip | |
Corrected relationship of macro and rust parsers
Diffstat (limited to 'src/doc/rustc-dev-guide')
| -rw-r--r-- | src/doc/rustc-dev-guide/src/macro-expansion.md | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/doc/rustc-dev-guide/src/macro-expansion.md b/src/doc/rustc-dev-guide/src/macro-expansion.md index da4615128a2..a7777e80c3e 100644 --- a/src/doc/rustc-dev-guide/src/macro-expansion.md +++ b/src/doc/rustc-dev-guide/src/macro-expansion.md @@ -2,12 +2,13 @@ Macro expansion happens during parsing. `rustc` has two parsers, in fact: the normal Rust parser, and the macro parser. During the parsing phase, the normal -Rust parser will call into the macro parser when it encounters a macro -definition or macro invocation (TODO: verify). The macro parser, in turn, may -call back out to the Rust parser when it needs to bind a metavariable (e.g. -`$my_expr`) while parsing the contents of a macro invocation. The code for macro -expansion is in [`src/libsyntax/ext/tt/`][code_dir]. This chapter aims to -explain how macro expansion works. +Rust parser will set aside the contents of macros and their invokations. Later, +before name resolution, macros are expanded using these portions of the code. +The macro parser, in turn, may call the normal Rust parser when it needs to +bind a metavariable (e.g. `$my_expr`) while parsing the contents of a macro +invocation. The code for macro expansion is in +[`src/libsyntax/ext/tt/`][code_dir]. This chapter aims to explain how macro +expansion works. ### Example |
