//! Used by plugin crates to tell `rustc` about the plugins they provide.
+use lint::LintPassObject;
+
use syntax::ext::base::{SyntaxExtension, NamedSyntaxExtension, NormalTT};
-use syntax::ext::base::{IdentTT, ItemDecorator, ItemModifier, BasicMacroExpander};
+use syntax::ext::base::{IdentTT, LetSyntaxTT, ItemDecorator, ItemModifier, BasicMacroExpander};
use syntax::ext::base::{MacroExpanderFn};
use syntax::codemap::Span;
use syntax::parse::token;
#[doc(hidden)]
pub syntax_exts: Vec<NamedSyntaxExtension>,
+
+ #[doc(hidden)]
+ pub lint_passes: Vec<LintPassObject>,
}
impl Registry {
Registry {
krate_span: krate.span,
syntax_exts: vec!(),
+ lint_passes: vec!(),
}
}
IdentTT(ext, _) => IdentTT(ext, Some(self.krate_span)),
ItemDecorator(ext) => ItemDecorator(ext),
ItemModifier(ext) => ItemModifier(ext),
+ // there's probably a nicer way to signal this:
+ LetSyntaxTT(_, _) => fail!("can't register a new LetSyntax!"),
}));
}
span: None,
}, None));
}
+
+ /// Register a compiler lint pass.
+ pub fn register_lint_pass(&mut self, lint_pass: LintPassObject) {
+ self.lint_passes.push(lint_pass);
+ }
}