Permalink
Browse files

polish coding style

  • Loading branch information...
yihuang committed Aug 30, 2012
1 parent bf822a4 commit a26ecd1563dd2a2309844bf3e62be17e30f068de
Showing with 10 additions and 10 deletions.
  1. +10 −10 Text/HTML/TagStream/ByteString.hs
@@ -22,8 +22,8 @@ type Attr = Attr' ByteString
-}
quoted :: Char -> Parser ByteString
quoted q = S.append <$> takeTill (in2 ('\\',q))
- <*> ( char q *> pure ""
- <|> char '\\' *> atLeast 1 (quoted q) )
+ <*> ( char q *> pure ""
+ <|> char '\\' *> atLeast 1 (quoted q) )
quotedOr :: Parser ByteString -> Parser ByteString
quotedOr p = maybeP (satisfy (in2 ('"','\''))) >>=
@@ -78,27 +78,27 @@ attrs = loop []
comment :: Parser Token
comment = Comment <$> comment'
where comment' = S.append <$> takeTill (=='-')
- <*> ( string "-->" *> return ""
- <|> atLeast 1 comment' )
+ <*> ( string "-->" *> return ""
+ <|> atLeast 1 comment' )
{--
- tags begine with <! , e.g. <!DOCTYPE ...>
-}
special :: Parser Token
special = Special
<$> ( S.cons <$> satisfy (not . ((=='-') ||. isSpace))
- <*> takeTill ((=='>') ||. isSpace)
- <* skipSpace )
+ <*> takeTill ((=='>') ||. isSpace)
+ <* skipSpace )
<*> takeTill (=='>') <* char '>'
{--
- parse a tag, can fail.
-}
tag :: Parser Token
tag = do
- t <- string "/" *> return TagTypeClose
- <|> string "!" *> return TagTypeSpecial
- <|> return TagTypeNormal
+ t <- string "/" *> return TagTypeClose
+ <|> string "!" *> return TagTypeSpecial
+ <|> return TagTypeNormal
case t of
TagTypeClose ->
TagClose <$> takeTill (=='>')
@@ -125,7 +125,7 @@ text = Text <$> atLeast 1 (takeTill (=='<'))
token :: Parser Token
token = char '<' *> (tag <|> incomplete)
- <|> text
+ <|> text
{--
- treat script tag specially, can't fail.

0 comments on commit a26ecd1

Please sign in to comment.