aboutsummaryrefslogtreecommitdiffstats
path: root/components/plugins/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/plugins/lib.rs')
-rw-r--r--components/plugins/lib.rs18
1 files changed, 15 insertions, 3 deletions
diff --git a/components/plugins/lib.rs b/components/plugins/lib.rs
index 2d00c8d3f3b..2a06fb36f74 100644
--- a/components/plugins/lib.rs
+++ b/components/plugins/lib.rs
@@ -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));