What you describe is the status quo for syntax extensions and macros.

The standard way for a syntax extension (built into the Rust compiler, not
a macro) to operate is to use the macro parser (which in turn uses the Rust
parser) to turn token trees into AST nodes. See libsyntax/ext/ for
implementations of existing syntax extensions.

If you want to write a macro, on the other hand, which is sufficient for
most needs, then you don't need to do anything, because this is what macros
already do -- as soon as they parse, say, `$s1:stmt`, `s1` is a statement
AST node, ready for interpolation.

Does this help?

Paul
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to