Skip to content

Commit 9c42f45

Browse files
committed
Procedural macros
This RFC proposes an evolution of Rust's procedural macro system (aka syntax extensions, aka compiler plugins). This RFC specifies syntax for the definition of procedural macros, a high-level view of their implementation in the compiler, and outlines how they interact with the compilation process. At the highest level, macros are defined by implementing functions marked with a `#[macro]` attribute. Macros operate on a list of tokens provided by the compiler and return a list of tokens that the macro use is replaced by. We provide low-level facilities for operating on these tokens. Higher level facilities (e.g., for parsing tokens to an AST) should exist as library crates.
1 parent 1fea0c8 commit 9c42f45

File tree

1 file changed

+417
-0
lines changed

1 file changed

+417
-0
lines changed

0 commit comments

Comments
 (0)