pub fn parse_rule(line: &str, source: &str) -> Result<Rule, ParseError>Expand description
Parse a single rule line into a Rule.
Accepted forms (DSL §3.2):
"require(...)"→ rule-level shorthand, desugars towhen: <negated condition> do: denyper DSL §8.1"<predicate>: <action>"→ Rule { condition, action }"<predicate>"→ Rule { condition, action: Deny } (default)"<action>"(action only) → treated as form 3 (always-true predicate)
Step kinds (plugin(...), taint(...), cedar:, opa(...) etc.)
are handled by parse_step, not here. This function specifically parses
predicate-and-action rules; callers that don’t know which they have
should use parse_step instead.