Skip to content

Commit 1627505

Browse files
committed
Start macro expansion chapter
1 parent 3b4fab4 commit 1627505

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Diff for: src/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)