Skip to content

Commit d45fc2c

Browse files
committedJan 25, 2018
Start macro expansion chapter
1 parent eaa28eb commit d45fc2c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
 

‎src/src/chap-060-macro-expansion.md

+11
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
11
# Macro expansion
2+
3+
Macro expansion happens during parsing. `rustc` has two parsers, in fact: the
4+
normal Rust parser, and the macro parser. During the parsing phase, the normal
5+
Rust parser will call into the macro parser when it encounters a macro. The
6+
macro parser, in turn, may call back out to the Rust parser when it needs to
7+
bind a metavariable (e.g. `$expr`). There are a few aspects of this system to be
8+
explained. The code for macro expansion is in `src/libsyntax/ext/tt/`.
9+
10+
TODO: explain parsing of macro definitions
11+
12+
TODO: explain parsing of macro invokations + macro expansion

0 commit comments

Comments
 (0)