HStringTemplate 0.6.6 → 0.6.8
raw patch · 3 files changed
+11/−6 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
HStringTemplate.cabal view
@@ -1,5 +1,5 @@ name: HStringTemplate-version: 0.6.6+version: 0.6.8 synopsis: StringTemplate implementation in Haskell. description: A port of the Java library by Terrence Parr. category: Text@@ -41,4 +41,4 @@ source-repository head type: darcs- location: http://code.haskell.org/HStringTemplate/+ location: http://patch-tag.com/r/sclv/hstringtemplate
Text/StringTemplate/Base.hs view
@@ -323,8 +323,13 @@ around x p y = do {_ <- char x; v<-p; _ <- char y; return v} spaced :: GenParser Char st t -> GenParser Char st t spaced p = do {spaces; v<-p; spaces; return v}++identifierChar :: GenParser Char st Char+identifierChar = alphaNum <|> char '_'+ word :: GenParser Char st String-word = many1 alphaNum+word = many1 identifierChar+ comlist :: GenParser Char st a -> GenParser Char st [a] comlist p = spaced (p `sepBy1` spaced (char ',')) @@ -536,7 +541,7 @@ -mkIndex :: Num b => [b] -> [[SElem a]]+mkIndex :: (Num b, Show b) => [b] -> [[SElem a]] mkIndex = map ((:) . STR . show . (1+) <*> (:[]) . STR . show) ix0 :: [SElem a] ix0 = [STR "1",STR "0"]@@ -567,7 +572,7 @@ regTemplate :: Stringable a => TmplParser (([SElem a], [SElem a]) -> SEnv a -> a) regTemplate = do try (functn::TmplParser (SEnv String -> SElem String)) .>> fail "" <|> return ()- name <- justSTR <$> many1 (alphaNum <|> char '/'<|> char '_')+ name <- justSTR <$> many1 (identifierChar <|> char '/') <|> around '(' subexprn ')' tryTellTmpl (name nullEnv) vals <- around '(' (spaced $ try assgn <|> anonassgn <|> return []) ')'
Text/StringTemplate/Instances.hs view
@@ -83,7 +83,7 @@ instance ToSElem Integer where toSElem = STR . show -instance Integral a => ToSElem (Ratio a) where+instance (Integral a, Show a) => ToSElem (Ratio a) where toSElem = STR . show --Dates and Times