@@ -2082,17 +2082,6 @@ fn parse_stage(src: &str) -> Result<Stage, ParseError> {
20822082 ( "redact" , None ) => Ok ( Stage :: Redact { condition : None } ) ,
20832083 ( "omit" , None ) => Ok ( Stage :: Omit ) ,
20842084 ( "hash" , None ) => Ok ( Stage :: Hash ) ,
2085- // Scan placeholders parse as bare identifiers.
2086- ( "pii.redact" , None ) => Ok ( Stage :: Scan {
2087- kind : ScanKind :: PiiRedact ,
2088- } ) ,
2089- ( "pii.detect" , None ) => Ok ( Stage :: Scan {
2090- kind : ScanKind :: PiiDetect ,
2091- } ) ,
2092- ( "injection.scan" , None ) => Ok ( Stage :: Scan {
2093- kind : ScanKind :: InjectionScan ,
2094- } ) ,
2095-
20962085 ( "mask" , Some ( a) ) => parse_stage_mask ( a, & bad) ,
20972086 ( "redact" , Some ( a) ) => parse_stage_redact_cond ( a, src) ,
20982087 ( "hash" , Some ( _) ) => Err ( bad ( "hash takes no arguments" ) ) ,
@@ -2103,10 +2092,20 @@ fn parse_stage(src: &str) -> Result<Stage, ParseError> {
21032092 ( "enum" , Some ( a) ) => parse_stage_enum ( a, & bad) ,
21042093 ( "regex" , Some ( a) ) => Ok ( parse_stage_regex ( a) ) ,
21052094 ( "validate" , Some ( a) ) => Err ( parse_stage_validate_rejected ( a, & bad) ) ,
2106- // `run` is an alias for `plugin` (mirrors the policy-step alias).
21072095 ( "plugin" | "run" , Some ( a) ) => parse_stage_plugin ( head, a, & bad) ,
21082096 ( "taint" , Some ( a) ) => parse_taint ( a, src) ,
21092097
2098+ // Scan placeholders parse as bare identifiers.
2099+ ( "pii.redact" , None ) => Ok ( Stage :: Scan {
2100+ kind : ScanKind :: PiiRedact ,
2101+ } ) ,
2102+ ( "pii.detect" , None ) => Ok ( Stage :: Scan {
2103+ kind : ScanKind :: PiiDetect ,
2104+ } ) ,
2105+ ( "injection.scan" , None ) => Ok ( Stage :: Scan {
2106+ kind : ScanKind :: InjectionScan ,
2107+ } ) ,
2108+
21102109 ( other, _) => Err ( bad ( & format ! ( "unknown stage `{}`" , other) ) ) ,
21112110 }
21122111}
0 commit comments