Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
lymar committed Feb 3, 2012
1 parent cbb7058 commit e4262ea
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions Text/Hastache.hs
Original file line number Diff line number Diff line change
Expand Up @@ -348,18 +348,18 @@ renderBlock contexts symb inTag afterClose otag ctag conf
tlInTag = tail inTag
readContext = map ($ tlInTag) contexts
~> List.find (not . isMuNothing)
processAndNext = do
processBlock sectionContent contexts otag ctag conf
next afterSection
in
if symb == ord8 '#'
then case readContext of
then case readContext of -- section
Just (MuList []) -> next afterSection
Just (MuList b) -> do
mapM_ (\c -> processBlock sectionContent
(c:contexts) otag ctag conf) b
next afterSection
Just (MuBool True) -> do
processBlock sectionContent
contexts otag ctag conf
next afterSection
Just (MuBool True) -> processAndNext
Just (MuLambda func) -> do
func sectionContent ~> toLByteString ~> addResLZ
next afterSection
Expand All @@ -368,19 +368,10 @@ renderBlock contexts symb inTag afterClose otag ctag conf
toLByteString res ~> addResLZ
next afterSection
_ -> next afterSection
else case readContext of
Just (MuList []) -> do
processBlock sectionContent
contexts otag ctag conf
next afterSection
Just (MuBool False) -> do
processBlock sectionContent
contexts otag ctag conf
next afterSection
Nothing -> do
processBlock sectionContent
contexts otag ctag conf
next afterSection
else case readContext of -- inverted section
Just (MuList []) -> processAndNext
Just (MuBool False) -> processAndNext
Nothing -> processAndNext
_ -> next afterSection
-- set delimiter
| symb == ord8 '=' =
Expand Down

0 comments on commit e4262ea

Please sign in to comment.