Add documentation to plugins crate

This commit is contained in:
Manish Goregaokar 2014-11-06 00:46:12 +05:30
parent 026b5e34ea
commit 6c9ee378f5
4 changed files with 44 additions and 8 deletions

View file

@ -2,6 +2,16 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//! Servo's compiler plugin/macro crate
//!
//! Attributes this crate provides:
//!
//! - `#[privatize]` : Forces all fields in a struct/enum to be private
//! - `#[jstraceable]` : Auto-derives an implementation of `JSTraceable` for a struct in the script crate
//! - `#[must_root]` : Prevents data of the marked type from being used on the stack. See the lints module for more details
//! - `#[dom_struct]` : Implies `#[privatize]`,`#[jstraceable]`, and `#[must_root]`.
//! Use this for structs that correspond to a DOM type
#![feature(macro_rules, plugin_registrar, quote, phase)]
#![deny(unused_imports, unused_variable)]
@ -19,10 +29,12 @@ use syntax::ext::base::{Decorator, Modifier};
use syntax::parse::token::intern;
mod lints;
mod macros;
mod jstraceable;
// Public for documentation to show up
/// Handles the auto-deriving for `#[jstraceable]`
pub mod jstraceable;
pub mod lints;
mod macros;
#[plugin_registrar]
pub fn plugin_registrar(reg: &mut Registry) {
reg.register_syntax_extension(intern("dom_struct"), Modifier(box jstraceable::expand_dom_struct));