[][src]Macro cssparser::match_ignore_ascii_case

macro_rules! match_ignore_ascii_case {
    ( $input:expr,
        $(
            $( #[$meta: meta] )*
            $( $pattern: pat )|+ $( if $guard: expr )? => $then: expr
        ),+
        $(,)?
    ) => { ... };
}

Expands to a match expression with string patterns, matching case-insensitively in the ASCII range.

The patterns must not contain ASCII upper case letters. (They must be already be lower-cased.)

Example

#[macro_use] extern crate cssparser;

match_ignore_ascii_case! { &function_name,
    "rgb" => parse_rgb(..),
    "rgba" => parse_rgba(..),
    "hsl" => parse_hsl(..),
    "hsla" => parse_hsla(..),
    _ => Err(format!("unknown function: {}", function_name))
}