yst 0.2 → 0.2.1
raw patch · 3 files changed
+11/−4 lines, 3 files
Files
- README.markdown +1/−1
- Yst/Yaml.hs +9/−2
- yst.cabal +1/−1
README.markdown view
@@ -490,5 +490,5 @@ [markdown]: http://daringfireball.com/markdown [pandoc]: http://johnmacfarlane.net/pandoc/ [vim]: http://www.vim.org/-+[GHC]: http://www.haskell.org/ghc/
Yst/Yaml.hs view
@@ -37,8 +37,15 @@ Nothing -> NString (unpackBuf s) Just d -> NDate d EMap xs | all (\(k,_) -> isStrNode k) xs -> NMap pairs- where pairs = map mkPair xs- mkPair (k,v) = (strFrom k, yamlNodeToNode v)+ where pairs = foldr addPair [] xs+ addPair (k,v) acc = if isStrNode k && strFrom k == "<<" -- hash merge, unsupported in Syck!+ then case n_elem v of -- so we do it ourselves+ EMap ys -> foldr addPair acc ys+ _ -> error "Tried hash merge on non-hash"+ else case lookup kstr acc of+ Just _ -> acc -- overridden+ Nothing -> (kstr, yamlNodeToNode v) : acc+ where kstr = strFrom k EMap _ -> error "Map keys must all be strings." ESeq xs -> NList $ map yamlNodeToNode xs ENil -> NNil
yst.cabal view
@@ -1,5 +1,5 @@ name: yst-version: 0.2+version: 0.2.1 Cabal-version: >= 1.2 build-type: Simple synopsis: Builds a static website from templates and data in YAML or