Skip to content

Instantly share code, notes, and snippets.

@uzytkownik
Created January 25, 2014 23:48
Show Gist options
  • Save uzytkownik/8625649 to your computer and use it in GitHub Desktop.
Save uzytkownik/8625649 to your computer and use it in GitHub Desktop.
#[feature(macro_registrar)]
extern mod syntax;
use syntax::ast::{Name};
use syntax::ext::base::{SyntaxExtension};
#[macro_registrar]
fn macro_registrar(register: |Name, SyntaxExtension|) {
use syntax::ext::base::{SyntaxExpanderTTExpanderWithoutContext,NormalTT};
use syntax::parse::token;
let test = &'static |exp, span, token_tree, context| {
use syntax::ext::base::{MacResult};
MacResult::dummy_expr()
};
register(token::intern(&"test"),
NormalTT(~SyntaxExpanderTTExpanderWithoutContext(cxx_call_expand)));
}
pub fn main() {
}
@uzytkownik
Copy link
Author

cxx_call_expand should be test of course ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment