Such is not possible at the moment. Syntax extensions operate on token trees, not AST. Maybe you'd be able to parse the input? Not sure, not my knowledge area.
On Wed, Sep 18, 2013 at 7:54 PM, Vadim <[email protected]> wrote: > Hi, > I want to write a syntax extension that operates on Rust AST, not on > individual tokens. For example: > > fn foo() { > ... > my_ext!{ > <statement1>; > <statement2>; > ... > } > ... > } > where <statement 1..N> are normal Rust statements. > > I want to get the AST for code enclosed inside my extension block, transform > it, and insert in place of the original node(s). > > Any pointers to where to start? Are there any existing extensions that do > something close to what I want? > > Vadim > > _______________________________________________ > Rust-dev mailing list > [email protected] > https://mail.mozilla.org/listinfo/rust-dev > _______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
