imp:csv: improve debug=7 output from isBlockActive
This commit is contained in:
parent
786f5dd72a
commit
1010e3dee6
@ -774,7 +774,6 @@ isBlockActive rules record CB{..} = any (all matcherMatches) $ groupedMatchers c
|
|||||||
matcherMatches :: Matcher -> Bool
|
matcherMatches :: Matcher -> Bool
|
||||||
matcherMatches (RecordMatcher prefix pat) = maybeNegate prefix origbool
|
matcherMatches (RecordMatcher prefix pat) = maybeNegate prefix origbool
|
||||||
where
|
where
|
||||||
pat' = dbg7 "regex" pat
|
|
||||||
-- A synthetic whole CSV record to match against. Note, this can be
|
-- A synthetic whole CSV record to match against. Note, this can be
|
||||||
-- different from the original CSV data:
|
-- different from the original CSV data:
|
||||||
-- - any whitespace surrounding field values is preserved
|
-- - any whitespace surrounding field values is preserved
|
||||||
@ -782,12 +781,12 @@ isBlockActive rules record CB{..} = any (all matcherMatches) $ groupedMatchers c
|
|||||||
-- - and the field separator is always comma
|
-- - and the field separator is always comma
|
||||||
-- which means that a field containing a comma will look like two fields.
|
-- which means that a field containing a comma will look like two fields.
|
||||||
wholecsvline = dbg7 "wholecsvline" $ T.intercalate "," record
|
wholecsvline = dbg7 "wholecsvline" $ T.intercalate "," record
|
||||||
origbool = regexMatchText pat' wholecsvline
|
origbool = regexMatchText (dbg7 "regex" pat) wholecsvline
|
||||||
matcherMatches (FieldMatcher prefix csvfieldref pat) = maybeNegate prefix origbool
|
matcherMatches (FieldMatcher prefix csvfieldref pat) = maybeNegate prefix origbool
|
||||||
where
|
where
|
||||||
-- the value of the referenced CSV field to match against.
|
-- the value of the referenced CSV field to match against.
|
||||||
csvfieldvalue = dbg7 "csvfieldvalue" $ replaceCsvFieldReference rules record csvfieldref
|
csvfieldvalue = dbg7 "csvfieldvalue" $ replaceCsvFieldReference rules record csvfieldref
|
||||||
origbool = regexMatchText pat csvfieldvalue
|
origbool = regexMatchText (dbg7 "regex" pat) csvfieldvalue
|
||||||
|
|
||||||
-- | 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