Skip to content

Commit

Permalink
Fix #16: export decodePatternSet and decodeCharacterClass
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasabel committed Jul 18, 2022
1 parent d1fcc58 commit d95cfc9
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions lib/Text/Regex/TDFA/TNFA.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@
--
-- Uses recursive do notation.

module Text.Regex.TDFA.TNFA(patternToNFA
,QNFA(..),QT(..),QTrans,TagUpdate(..)) where
module Text.Regex.TDFA.TNFA
( patternToNFA
, decodeCharacterClass, decodePatternSet
, QNFA(..), QT(..), QTrans, TagUpdate(..)
) where

{- By Chris Kuklewicz, 2007. BSD License, see the LICENSE file. -}

Expand Down Expand Up @@ -786,7 +789,7 @@ ADD ORPHAN ID check and make this a fatal error while testing
-}

-- | decodePatternSet cannot handle collating element and treats
-- | @decodePatternSet@ cannot handle collating element and treats
-- equivalence classes as just their definition and nothing more.
decodePatternSet :: PatternSet -> S.Set Char
decodePatternSet (PatternSet msc mscc _ msec) =
Expand All @@ -795,9 +798,9 @@ decodePatternSet (PatternSet msc mscc _ msec) =
withMSEC = foldl (flip S.insert) withMSCC (maybe [] (concatMap unSEC . S.toAscList) msec)
in withMSEC

-- | This returns the distinct ascending list of characters
-- represented by [: :] values in legalCharacterClasses; unrecognized
-- class names return an empty string
-- | This returns the strictly ascending list of characters
-- represented by @[: :]@ POSIX character classes.
-- Unrecognized class names return an empty string.
decodeCharacterClass :: PatternSetCharacterClass -> String
decodeCharacterClass (PatternSetCharacterClass s) =
case s of
Expand Down

0 comments on commit d95cfc9

Please sign in to comment.