macro_rules! parse {
(in $bump: ident $(with $features: ident)? &$source_text: ident as $ty: ty) => { ... };
(in $bump: ident $(with $features: ident)? $str: literal as $ty: ty) => { ... };
(in $bump: ident $(with $features: ident)? $str: literal) => { ... };
(in $bump: ident $(with $features: ident)? &$str: ident) => { ... };
}
Expand description
A macro for easily calling the Parser and entirely parsing a string.
ยงExample
use css_parse::*;
use bumpalo::Bump;
let bump = Bump::default();
parse!(in bump "foo"); // ComponentValues
parse!(in bump "foo" as T![Ident]);
let features = Feature::SingleLineComments;
parse!(in bump with features "//foo");
// Or pass a reference to a str
let source = "//foo";
let features = Feature::SingleLineComments;
parse!(in bump with features &source);