pub fn policy(i: &str) -> IResult<&str, builder::Policy, Error> {
    let (i, policy) = policy_inner(i)?;

    let (i, _) = error(
        preceded(space0, eof),
        |input| {
            match input.chars().next() {
            Some(')') => "unexpected parens".to_string(),
            //Some('$') => "variables are not allowed in facts".to_string(),
            _ => format!("expected either the next term after ',' or the next policy variant after 'or', but got '{}'",
                     input)
        }
        },
        " ,\n",
    )(i)?;

    Ok((i, policy))
}
/// parse an allow or deny rule
parse an allow or deny rule
parse an allow or deny rule
pub fn policy(i: &str) -> IResult<&str, builder::Policy, Error> {
    let (i, policy) = policy_inner(i)?;
    let (i, _) = error(
        preceded(space0, eof),
        |input| {
            match input.chars().next() {
            Some(')') => "unexpected parens".to_string(),
            //Some('$') => "variables are not allowed in facts".to_string(),
            _ => format!("expected either the next term after ',' or the next policy variant after 'or', but got '{}'",
                     input)
        }
        },
        " ,\n",
    )(i)?;
    Ok((i, policy))
}
pub fn policy ( i : & str ) -> IResult < & str , builder :: Policy , Error > { let ( i , policy ) = policy_inner ( i ) ? ; let ( i , _ ) = error ( preceded ( space0 , eof ) , | input | { match input . chars ( ) . next ( ) { Some ( ')' ) => " " . to_string ( ) , //Some('$') => "variables are not allowed in facts".to_string(), _ => format ! ( " " input ) } } , " \n " , ) ( i ) ? ; Ok ( ( i , policy ) ) }
parse an allow or deny rule
parse an allow or deny rule
i
&str
i
&str