1
Fork 0

Add a syntax extension to log syntax, for debugging macros.

This commit is contained in:
Paul Stansifer 2011-08-08 14:17:33 -07:00
parent e7139e28f4
commit f50a582126
3 changed files with 22 additions and 3 deletions

View file

@ -0,0 +1,13 @@
import std::option;
import base::*;
import syntax::ast;
fn expand_syntax_ext(cx: &ext_ctxt, sp: codemap::span, arg: @ast::expr,
body: option::t[str]) -> @ast::expr {
cx.print_backtrace();
std::io::stdout().write_line(print::pprust::expr_to_str(arg));
//trivial expression
ret @{id: cx.next_id(), node: ast::expr_rec(~[], option::none), span: sp};
}