Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start using the ToCss trait, to be used for CSS serialization #4455

Merged
merged 8 commits into from Dec 29, 2014
@@ -50,3 +50,22 @@ pub fn plugin_registrar(reg: &mut Registry) {
reg.register_lint_pass(box lints::InheritancePass as LintPassObject);
}


#[macro_export]
macro_rules! match_ignore_ascii_case {
( $value: expr: $( $string: expr => $result: expr ),+ _ => $fallback: expr, ) => {
match_ignore_ascii_case! { $value:
$( $string => $result ),+
_ => $fallback
}
};
( $value: expr: $( $string: expr => $result: expr ),+ _ => $fallback: expr ) => {
{
use std::ascii::AsciiExt;
match $value.as_slice() {
$( s if s.eq_ignore_ascii_case($string) => $result, )+
_ => $fallback
}
}
};
}
@@ -104,8 +104,8 @@ fn lint_unrooted_ty(cx: &Context, ty: &ast::Ty, warning: &str) {
// Determines if a block is in an unsafe context so that an unhelpful
// lint can be aborted.
fn unsafe_context(map: &ast_map::Map, id: ast::NodeId) -> bool {
match map.get(map.get_parent(id)) {
ast_map::NodeImplItem(itm) => {
match map.find(map.get_parent(id)) {
Some(ast_map::NodeImplItem(itm)) => {
match *itm {
ast::MethodImplItem(ref meth) => match meth.node {
ast::MethDecl(_, _, _, _, style, _, _, _) => match style {
@@ -117,7 +117,7 @@ fn unsafe_context(map: &ast_map::Map, id: ast::NodeId) -> bool {
_ => false,
}
},
ast_map::NodeItem(itm) => {
Some(ast_map::NodeItem(itm)) => {
match itm.node {
ast::ItemFn(_, style, _, _, _) => match style {
ast::UnsafeFn => true,

Some generated files are not rendered by default. Learn more.

@@ -36,3 +36,5 @@ git = "https://github.com/servo/string-cache"
[dependencies.string_cache_macros]
git = "https://github.com/servo/string-cache"

[dependencies]
text_writer = "0.1.1"
@@ -18,6 +18,7 @@ extern crate collections;
extern crate geom;
extern crate serialize;
extern crate sync;
extern crate text_writer;
extern crate url;

extern crate cssparser;
@@ -27,6 +28,9 @@ extern crate string_cache;
#[phase(plugin)]
extern crate string_cache_macros;

#[phase(plugin)]
extern crate plugins;

#[phase(plugin)]
extern crate lazy_static;

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.