mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Add documentation to plugins crate
This commit is contained in:
parent
026b5e34ea
commit
6c9ee378f5
4 changed files with 44 additions and 8 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue