about summary refs log tree commit diff
path: root/src/libhexfloat
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/libhexfloat
parented41b71fbe69cc920a3a021ac4e96dc4d5cc488c (diff)
downloadrust-aca0bac29f7d7e86edfb5850cef1ab9b5e4797f2.tar.gz
rust-aca0bac29f7d7e86edfb5850cef1ab9b5e4797f2.zip
Convert libraries to use #[plugin_registrar]
Diffstat (limited to 'src/libhexfloat')
-rw-r--r--src/libhexfloat/lib.rs18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/libhexfloat/lib.rs b/src/libhexfloat/lib.rs
index 448f23eaedb..54bc2802b09 100644
--- a/src/libhexfloat/lib.rs
+++ b/src/libhexfloat/lib.rs
@@ -45,27 +45,23 @@ fn main() {
        html_root_url = "http://doc.rust-lang.org/")]
 
 #![deny(deprecated_owned_vector)]
-#![feature(macro_registrar, managed_boxes)]
+#![feature(plugin_registrar, managed_boxes)]
 
 extern crate syntax;
+extern crate rustc;
 
 use syntax::ast;
-use syntax::ast::Name;
 use syntax::codemap::{Span, mk_sp};
 use syntax::ext::base;
-use syntax::ext::base::{SyntaxExtension, BasicMacroExpander, NormalTT, ExtCtxt, MacExpr};
+use syntax::ext::base::{ExtCtxt, MacExpr};
 use syntax::ext::build::AstBuilder;
 use syntax::parse;
 use syntax::parse::token;
+use rustc::plugin::Registry;
 
-#[macro_registrar]
-pub fn macro_registrar(register: |Name, SyntaxExtension|) {
-    register(token::intern("hexfloat"),
-        NormalTT(box BasicMacroExpander {
-            expander: expand_syntax_ext,
-            span: None,
-        },
-        None));
+#[plugin_registrar]
+pub fn plugin_registrar(reg: &mut Registry) {
+    reg.register_macro("hexfloat", expand_syntax_ext);
 }
 
 //Check if the literal is valid (as LLVM expects),