imp:csv:if: show the problematic field name when warning
This commit is contained in:
parent
9696677c5d
commit
99fc4cd61f
@ -808,10 +808,9 @@ isBlockActive rules record CB{..} = any (all matcherMatches) $ groupedMatchers c
|
|||||||
matcherMatches = \case
|
matcherMatches = \case
|
||||||
RecordMatcher prefix pat -> maybeNegate prefix $ match pat $ T.intercalate "," record
|
RecordMatcher prefix pat -> maybeNegate prefix $ match pat $ T.intercalate "," record
|
||||||
FieldMatcher prefix csvfieldref pat -> maybeNegate prefix $ match pat $
|
FieldMatcher prefix csvfieldref pat -> maybeNegate prefix $ match pat $
|
||||||
fromMaybe (warn "'if %CSVFIELD' should use a name declared with 'fields', or a number" "") $
|
fromMaybe (warn msg "") $ replaceCsvFieldReference rules record csvfieldref
|
||||||
replaceCsvFieldReference rules record csvfieldref
|
where msg = "if "<>T.unpack csvfieldref<>": this should be a name declared with 'fields', or %NUM"
|
||||||
where
|
where match p v = regexMatchText (dbg7 "regex" p) (dbg7 "value" v)
|
||||||
match p v = regexMatchText (dbg7 "regex" p) (dbg7 "value" v)
|
|
||||||
|
|
||||||
-- | Group matchers into associative pairs based on prefix, e.g.:
|
-- | Group matchers into associative pairs based on prefix, e.g.:
|
||||||
-- A
|
-- A
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user