diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2016-01-12 06:12:11 +0000 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2016-01-12 06:12:11 +0000 |
commit | 934558d25aa1074483ef722236e1e680abf13ebf (patch) | |
tree | e2bfde68b11cd62239ed814d86a165eb89223ea3 /bbcode | |
parent | 9bc6cd27e1c4b52f46e1b210b3d560c5340d1fe4 (diff) | |
download | thermoprint-934558d25aa1074483ef722236e1e680abf13ebf.tar thermoprint-934558d25aa1074483ef722236e1e680abf13ebf.tar.gz thermoprint-934558d25aa1074483ef722236e1e680abf13ebf.tar.bz2 thermoprint-934558d25aa1074483ef722236e1e680abf13ebf.tar.xz thermoprint-934558d25aa1074483ef722236e1e680abf13ebf.zip |
cleanup
Diffstat (limited to 'bbcode')
-rw-r--r-- | bbcode/src/Text/BBCode/Lexer.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bbcode/src/Text/BBCode/Lexer.hs b/bbcode/src/Text/BBCode/Lexer.hs index 7171a0e..03f57d2 100644 --- a/bbcode/src/Text/BBCode/Lexer.hs +++ b/bbcode/src/Text/BBCode/Lexer.hs | |||
@@ -29,11 +29,11 @@ data BBToken = BBOpen Text [(Text, Maybe Text)] -- ^ Tag open with attributes | |||
29 | token :: Parser BBToken | 29 | token :: Parser BBToken |
30 | -- ^ Tokenizer | 30 | -- ^ Tokenizer |
31 | token = BBClose <$> ("[/" *> escapedText' [']'] <* "]") | 31 | token = BBClose <$> ("[/" *> escapedText' [']'] <* "]") |
32 | <|> uncurry BBOpen <$> openTag | 32 | <|> uncurry BBOpen <$ "[" <*> openTag <* "]" |
33 | <|> BBStr <$> escapedText ['['] | 33 | <|> BBStr <$> escapedText ['['] |
34 | 34 | ||
35 | openTag :: Parser (Text, [(Text, Maybe Text)]) | 35 | openTag :: Parser (Text, [(Text, Maybe Text)]) |
36 | openTag = (,) <$ "[" <*> escapedText' [']', ' ', '='] <*> attrs' <* "]" | 36 | openTag = (,) <$> escapedText' [']', ' ', '='] <*> attrs' |
37 | 37 | ||
38 | attrs :: Parser [(Text, Maybe Text)] | 38 | attrs :: Parser [(Text, Maybe Text)] |
39 | attrs = (:) <$> (namedAttr <|> plainValue) <* takeWhile isSpace <*> attrs' | 39 | attrs = (:) <$> (namedAttr <|> plainValue) <* takeWhile isSpace <*> attrs' |