parseMustacheNode :: Parser MustacheNode
parseMustacheNode =
        try partial
    <|> try section
    <|> try invSection
    <|> try comment
    <|> try noEscapeVar
    <|> try ampVar
    <|> try var
    <|> try text
      where partial = MustachePartial <$>
              (mustache $ string "> " >> key) >>= stripNewline
            section = prefixSection '#' >>= \(name, mustache) ->
              return $ MustacheSection name mustache
            invSection = prefixSection '^' >>= \(name, mustache) ->
              return $ MustacheSectionInv name mustache
            comment = mustache (char '!' >> key) >> return MustacheComment
            noEscapeVar = MustacheVar True <$>
              (mustache $ between (char '{') (char '}') key)
            ampVar = MustacheVar True <$> (mustache $ string "& " >> key)
            var = MustacheVar False <$> (mustache key)
            text = MustacheText <$>
              (many1Till anyChar (try eof <|> startToken) >>= return . pack)
parseMustacheNode :: Parser MustacheNode
parseMustacheNode =
        try partial
    <|> try section
    <|> try invSection
    <|> try comment
    <|> try noEscapeVar
    <|> try ampVar
    <|> try var
    <|> try text
      where partial = MustachePartial <$>
              (mustache $ string "> " >> key) >>= stripNewline
            section = prefixSection '#' >>= \(name, mustache) ->
              return $ MustacheSection name mustache
            invSection = prefixSection '^' >>= \(name, mustache) ->
              return $ MustacheSectionInv name mustache
            comment = mustache (char '!' >> key) >> return MustacheComment
            noEscapeVar = MustacheVar True <$>
              (mustache $ between (char '{') (char '}') key)
            ampVar = MustacheVar True <$> (mustache $ string "& " >> key)
            var = MustacheVar False <$> (mustache key)
            text = MustacheText <$>
              (many1Till anyChar (try eof <|> startToken) >>= return . pack)
parseMustacheNode =
        try partial
    <|> try section
    <|> try invSection
    <|> try comment
    <|> try noEscapeVar
    <|> try ampVar
    <|> try var
    <|> try text
      where partial = MustachePartial <$>
              (mustache $ string "> " >> key) >>= stripNewline
            section = prefixSection '#' >>= \(name, mustache) ->
              return $ MustacheSection name mustache
            invSection = prefixSection '^' >>= \(name, mustache) ->
              return $ MustacheSectionInv name mustache
            comment = mustache (char '!' >> key) >> return MustacheComment
            noEscapeVar = MustacheVar True <$>
              (mustache $ between (char '{') (char '}') key)
            ampVar = MustacheVar True <$> (mustache $ string "& " >> key)
            var = MustacheVar False <$> (mustache key)
            text = MustacheText <$>
              (many1Till anyChar (try eof <|> startToken) >>= return . pack)