hamlet 0.7.0.2 → 0.7.1
raw patch · 4 files changed
+23/−6 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Text.Cassius: class ToCss a
+ Text.Cassius: toCss :: ToCss a => a -> Text
Files
- Text/Cassius.hs +10/−3
- Text/Shakespeare.hs +7/−2
- hamlet.cabal +1/−1
- runtests.hs +5/−0
Text/Cassius.hs view
@@ -3,16 +3,23 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE CPP #-} module Text.Cassius- ( Cassius+ ( -- * Datatypes+ Cassius , Css+ -- * Type class+ , ToCss (..)+ -- * Rendering , renderCassius , renderCss+ -- * Parsing , cassius+ , cassiusFile+ , cassiusFileDebug+ -- * ToCss instances+ -- ** Color , Color (..) , colorRed , colorBlack- , cassiusFile- , cassiusFileDebug #if HAMLET6TO7 , parseBlocks , Content (..)
Text/Shakespeare.hs view
@@ -96,8 +96,13 @@ where delim = (many1 (char ' ') >> return()) <|> lookAhead (char '(' >> return ())+ derefOp = try $ do+ _ <- char '('+ x <- many1 $ noneOf " \t\n\r()"+ _ <- char ')'+ return $ DerefIdent $ Ident x derefParens = between (char '(') (char ')') parseDeref- derefSingle = derefParens <|> numeric <|> strLit<|> ident+ derefSingle = derefOp <|> derefParens <|> numeric <|> strLit<|> ident deref' lhs = dollar <|> derefSingle' <|> return (foldl1 DerefBranch $ lhs [])@@ -153,7 +158,7 @@ [] -> error $ t ++ " read failed: " ++ s expType :: Ident -> Name -> Exp-expType (Ident (c:_)) = if isUpper c then ConE else VarE+expType (Ident (c:_)) = if isUpper c || c == ':' then ConE else VarE expType (Ident "") = error "Bad Ident" derefToExp :: Scope -> Deref -> Exp
hamlet.cabal view
@@ -1,5 +1,5 @@ name: hamlet-version: 0.7.0.2+version: 0.7.1 license: BSD3 license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>
runtests.hs view
@@ -97,6 +97,7 @@ , testCase "embedded slash" caseEmbeddedSlash , testCase "string literals" caseStringLiterals , testCase "embed json" caseEmbedJson + , testCase "interpolated operators" caseOperators ] data Url = Home | Sub SubUrl @@ -900,3 +901,7 @@ ]) ] jelper "{\"foo\":[\"bar\",5.0]}" [$julius|#{v}|] + +caseOperators = do + helper "3" [$hamlet|#{show $ (+) 1 2}|] + helper "6" [$hamlet|#{show $ sum $ (:) 1 ((:) 2 $ return 3)}|]