css_parse/macros/
parse.rs1#[macro_export]
22macro_rules! parse {
23 (in $bump: ident $(with $features: ident)? &$source_text: ident as $ty: ty) => {
24 {
25 let mut p = $crate::Parser::new(&$bump, $source_text)$(.with_features($features))?;
26 p.parse_entirely::<$ty>()
27 }
28 };
29 (in $bump: ident $(with $features: ident)? $str: literal as $ty: ty) => {
30 {
31 let source_text = $str;
32 parse!(in $bump $(with $features)? &source_text as $ty)
33 }
34 };
35 (in $bump: ident $(with $features: ident)? $str: literal) => {
36 {
37 use $crate::ComponentValues;
38 parse!(in $bump $(with $features)? $str as ComponentValues)
39 }
40 };
41 (in $bump: ident $(with $features: ident)? &$str: ident) => {
42 {
43 use $crate::ComponentValues;
44 parse!(in $bump $(with $features)? &$str as ComponentValues)
45 }
46 };
47}