diff options
| author | Gregor Kleen <gkleen@yggdrasil.li> | 2016-01-12 00:56:58 +0000 |
|---|---|---|
| committer | Gregor Kleen <gkleen@yggdrasil.li> | 2016-01-12 00:56:58 +0000 |
| commit | fea4f8690111a8bbb65845fb61961cfc0a9802cc (patch) | |
| tree | 4891920c1c4bea4d2caae75820fac90de7c0f0f9 /bbcode/src/Text/BBCode | |
| parent | ef4a0aaff4adbb56a16c62390b49d5211adcff22 (diff) | |
| download | thermoprint-fea4f8690111a8bbb65845fb61961cfc0a9802cc.tar thermoprint-fea4f8690111a8bbb65845fb61961cfc0a9802cc.tar.gz thermoprint-fea4f8690111a8bbb65845fb61961cfc0a9802cc.tar.bz2 thermoprint-fea4f8690111a8bbb65845fb61961cfc0a9802cc.tar.xz thermoprint-fea4f8690111a8bbb65845fb61961cfc0a9802cc.zip | |
removed unused Arbitrary BBToken
Diffstat (limited to 'bbcode/src/Text/BBCode')
| -rw-r--r-- | bbcode/src/Text/BBCode/Lexer.hs | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/bbcode/src/Text/BBCode/Lexer.hs b/bbcode/src/Text/BBCode/Lexer.hs index 8060ed0..01f47f0 100644 --- a/bbcode/src/Text/BBCode/Lexer.hs +++ b/bbcode/src/Text/BBCode/Lexer.hs | |||
| @@ -25,25 +25,7 @@ import GHC.Generics (Generic) | |||
| 25 | data BBToken = BBOpen Text -- ^ Tag open | 25 | data BBToken = BBOpen Text -- ^ Tag open |
| 26 | | BBClose Text -- ^ Tag close | 26 | | BBClose Text -- ^ Tag close |
| 27 | | BBStr Text -- ^ Content of a tag | 27 | | BBStr Text -- ^ Content of a tag |
| 28 | deriving (Generic, Eq, Show, CoArbitrary) | 28 | deriving (Generic, Eq, Show) |
| 29 | |||
| 30 | -- | This instance does not produce: | ||
| 31 | -- | ||
| 32 | -- * opening and closing tags whose 'Text' ends in @\\@ | ||
| 33 | -- * empty 'BBStr's | ||
| 34 | instance Arbitrary BBToken where | ||
| 35 | shrink = genericShrink | ||
| 36 | arbitrary = oneof [ BBOpen <$> tagText | ||
| 37 | , BBClose <$> tagText | ||
| 38 | , BBStr <$> nonEmpty | ||
| 39 | ] | ||
| 40 | where | ||
| 41 | tagText = arbitrary `suchThat` (not . lastIsEscape) | ||
| 42 | lastIsEscape t | ||
| 43 | | T.null t = False | ||
| 44 | | T.last t == '\\' = True | ||
| 45 | | otherwise = False | ||
| 46 | nonEmpty = (arbitrary `suchThat` (not . T.null)) | ||
| 47 | 29 | ||
| 48 | token :: Parser BBToken | 30 | token :: Parser BBToken |
| 49 | -- ^ Tokenizer | 31 | -- ^ Tokenizer |
