/// Parses a core selector (component + tree + property). It accepts both raw selectors or
/// selectors wrapped in double quotes. Selectors wrapped in quotes accept spaces in the tree and
/// property names and require internal quotes to be escaped.
Parses a core selector (component + tree + property). It accepts both raw selectors or
selectors wrapped in double quotes. Selectors wrapped in quotes accept spaces in the tree and
property names and require internal quotes to be escaped.
Parses a core selector ( component + tree + property ) . It accepts both raw selectors or selectors wrapped in double quotes . Selectors wrapped in quotes accept spaces in the tree and property names and require internal quotes to be escaped .
fn core_selector(input: &str) -> IResult<&str, (ComponentSelector<'_>, TreeSelector<'_>)> {
    if peek::<&str, _, (&str, ErrorKind), _>(tag("\""))(input).is_ok() {
        let (rest, (_, component, _, tree, _)) = tuple((
            tag("\""),
            component_selector,
            tag(":"),
            tree_selector(/*accept_spaces=*/ true),
            tag("\""),
        ))(input)?;
        Ok((rest, (component, tree)))
    } else {
        let (rest, (component, _, tree)) =
            tuple((component_selector, tag(":"), tree_selector(/*accept_spaces=*/ false)))(input)?;
        Ok((rest, (component, tree)))
    }
}
fn core_selector ( input : & str ) -> IResult < & str , ( ComponentSelector < ' _ > , TreeSelector < ' _ > ) > { if peek :: < & str , _ , ( & str , ErrorKind ) , _ > ( tag ( " \" " ) ) ( input ) . is_ok ( ) { let ( rest , ( _ , component , _ , tree , _ ) ) = tuple ( ( tag ( " \" " ) , component_selector , tag ( " " ) , tree_selector ( /*accept_spaces=*/ true ) , tag ( " \" " ) , ) ) ( input ) ? ; Ok ( ( rest , ( component , tree ) ) ) } else { let ( rest , ( component , _ , tree ) ) = tuple ( ( component_selector , tag ( " " ) , tree_selector ( /*accept_spaces=*/ false ) ) ) ( input ) ? ; Ok ( ( rest , ( component , tree ) ) ) } }
Parses a core selector (component + tree + property).
Parses a core selector ( component + tree + property ) .
input
&str