Struct rustc::plugin::registry::RegistryUnstable [-] [+] [src]

pub struct Registry<'a> {
    pub sess: &'a Session,
    // some fields omitted
}

Structure used to register plugins.

A plugin registrar function takes an &mut Registry and should call methods to register its plugins.

This struct has public fields and other methods for use by rustc itself. They are not documented here, and plugin authors should not use them.

Fields

sess

Compiler session. Useful if you want to emit diagnostic messages from the plugin registrar.

Methods

impl<'a> Registry<'a>

fn args<'b>(&'b self) -> &'b Vec<P<MetaItem>>

Get the plugin's arguments, if any.

These are specified inside the plugin crate attribute as

#![plugin(my_plugin_name(... args ...))]

fn register_syntax_extension(&mut self, name: Name, extension: SyntaxExtension)

Register a syntax extension of any kind.

This is the most general hook into libsyntax's expansion behavior.

fn register_macro(&mut self, name: &str, expander: MacroExpanderFn)

Register a macro of the usual kind.

This is a convenience wrapper for register_syntax_extension. It builds for you a NormalTT that calls expander, and also takes care of interning the macro's name.

fn register_lint_pass(&mut self, lint_pass: LintPassObject)

Register a compiler lint pass.

fn register_lint_group(&mut self, name: &'static str, to: Vec<&'static Lint>)

Register a lint group.