aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script
diff options
context:
space:
mode:
authorbors-servo <release+servo@mozilla.com>2014-03-25 12:37:49 -0400
committerbors-servo <release+servo@mozilla.com>2014-03-25 12:37:49 -0400
commit11639c34e65bedfcc34b8734e691b5b720f085e6 (patch)
treeb5e2d57d6d1ba8db1da5d03963b38e44463f70a9 /src/components/script
parent3401a568f276c55f90ec050df605492b900f79ac (diff)
parent79ca9b6eb00e5a5945f03221227a43919f67caa4 (diff)
downloadservo-11639c34e65bedfcc34b8734e691b5b720f085e6.tar.gz
servo-11639c34e65bedfcc34b8734e691b5b720f085e6.zip
auto merge of #1958 : mbrubeck/servo/macro-crate, r=kmcallister
This moves the bitfield! macro into a new shared `macros` crate as suggested in #1882.
Diffstat (limited to 'src/components/script')
-rw-r--r--src/components/script/macros.rs24
-rw-r--r--src/components/script/script.rs7
2 files changed, 3 insertions, 28 deletions
diff --git a/src/components/script/macros.rs b/src/components/script/macros.rs
deleted file mode 100644
index 0ebdd7c6b7e..00000000000
--- a/src/components/script/macros.rs
+++ /dev/null
@@ -1,24 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * 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/. */
-
-#[macro_escape];
-
-macro_rules! bitfield(
- ($bitfieldname:ident, $getter:ident, $setter:ident, $value:expr) => (
- impl $bitfieldname {
- #[inline]
- pub fn $getter(self) -> bool {
- let $bitfieldname(s) = self;
- (s & $value) != 0
- }
-
- #[inline]
- pub fn $setter(&mut self, value: bool) {
- let $bitfieldname(s) = *self;
- *self = $bitfieldname((s & !$value) | (if value { $value } else { 0 }))
- }
- }
- )
-)
-
diff --git a/src/components/script/script.rs b/src/components/script/script.rs
index 4c5a53efbe6..c9160b56131 100644
--- a/src/components/script/script.rs
+++ b/src/components/script/script.rs
@@ -8,7 +8,7 @@
#[comment = "The Servo Parallel Browser Project"];
#[license = "MPL"];
-#[feature(globs, macro_rules, struct_variant, managed_boxes)];
+#[feature(globs, macro_rules, struct_variant, managed_boxes, phase)];
extern crate collections;
extern crate geom;
@@ -16,6 +16,8 @@ extern crate hubbub;
extern crate encoding;
extern crate js;
extern crate serialize;
+#[phase(syntax)]
+extern crate servo_macros = "macros";
extern crate servo_net = "net";
extern crate servo_util = "util";
extern crate style;
@@ -23,9 +25,6 @@ extern crate servo_msg = "msg";
extern crate extra;
extern crate native;
-// Macros
-mod macros;
-
pub mod dom {
pub mod bindings {
pub mod js;