about summary refs log tree commit diff
path: root/src/libregex_macros
diff options
context:
space:
mode:
authorKeegan McAllister <kmcallister@mozilla.com>2014-05-24 21:31:50 -0700
committerKeegan McAllister <kmcallister@mozilla.com>2014-06-09 14:29:30 -0700
commitaca0bac29f7d7e86edfb5850cef1ab9b5e4797f2 (patch)
tree789fc211a957d515b86cc1b99421cf17e975d9fb /src/libregex_macros
parented41b71fbe69cc920a3a021ac4e96dc4d5cc488c (diff)
Convert libraries to use #[plugin_registrar]
Diffstat (limited to 'src/libregex_macros')
-rw-r--r--src/libregex_macros/lib.rs17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/libregex_macros/lib.rs b/src/libregex_macros/lib.rs
index fb7e4211d49..bbee09d0f38 100644
--- a/src/libregex_macros/lib.rs
+++ b/src/libregex_macros/lib.rs
@@ -19,24 +19,24 @@
        html_favicon_url = "http://www.rust-lang.org/favicon.ico",
        html_root_url = "http://doc.rust-lang.org/")]
 
-#![feature(macro_registrar, managed_boxes, quote)]
+#![feature(plugin_registrar, managed_boxes, quote)]
 
 extern crate regex;
 extern crate syntax;
+extern crate rustc;
 
 use std::rc::Rc;
 
 use syntax::ast;
 use syntax::codemap;
 use syntax::ext::build::AstBuilder;
-use syntax::ext::base::{
-    SyntaxExtension, ExtCtxt, MacResult, MacExpr, DummyResult,
-    NormalTT, BasicMacroExpander,
-};
+use syntax::ext::base::{ExtCtxt, MacResult, MacExpr, DummyResult};
 use syntax::parse;
 use syntax::parse::token;
 use syntax::print::pprust;
 
+use rustc::plugin::Registry;
+
 use regex::Regex;
 use regex::native::{
     OneChar, CharClass, Any, Save, Jump, Split,
@@ -46,11 +46,10 @@ use regex::native::{
 };
 
 /// For the `regex!` syntax extension. Do not use.
-#[macro_registrar]
+#[plugin_registrar]
 #[doc(hidden)]
-pub fn macro_registrar(register: |ast::Name, SyntaxExtension|) {
-    let expander = box BasicMacroExpander { expander: native, span: None };
-    register(token::intern("regex"), NormalTT(expander, None))
+pub fn plugin_registrar(reg: &mut Registry) {
+    reg.register_macro("regex", native);
 }
 
 /// Generates specialized code for the Pike VM for a particular regular