Changeset 9647 for src/Pugs/Prim/Yaml.hs
- Timestamp:
- 03/18/06 16:40:38 (3 years ago)
- svk:copy_cache_prev:
- 12197
- Files:
-
- 1 modified
-
src/Pugs/Prim/Yaml.hs (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Prim/Yaml.hs
r9309 r9647 42 42 hv <- liftSTM $ (newTVar (Map.fromList vals) :: STM IHash) 43 43 return $ VRef (hashRef hv) 44 Just s | Just (pre, post) <- Str.breakFirst ':' s45 , pre == Str.pack " pugs/Object" -> do44 Just s | (pre, post) <- Str.splitAt 16 s -- 16 == length "tag:pugs:Object:" 45 , pre == Str.pack "tag:pugs:Object:" -> do 46 46 let typ = Str.unpack post 47 47 vals <- forM nodes $ \(keyNode, valNode) -> do … … 50 50 return (key, val) 51 51 return . VObject =<< createObject (mkType typ) vals 52 Just s | s == Str.pack " pugs/Rule" -> do52 Just s | s == Str.pack "tag:pugs:Rule" -> do 53 53 vals <- forM nodes $ \(keyNode, valNode) -> do 54 54 key <- fromVal =<< fromYaml keyNode … … 110 110 hash <- fromVal v :: Eval VHash 111 111 attrs <- toYaml $ VRef (hashRef hash) 112 return $ tagNode (Just $ Str.pack $ "tag:pugs: object:" ++ showType (objType obj)) attrs113 toYaml (VRule MkRulePGE{rxRule=rule, rxGlobal=global, rxStringify=stringify, rxAdverbs=adverbs}) = do112 return $ tagNode (Just $ Str.pack $ "tag:pugs:Object:" ++ showType (objType obj)) attrs 113 toYaml (VRule MkRulePGE{rxRule=rule, rxGlobal=global, rxStringify=stringify, rxAdverbs=adverbs}) = do 114 114 adverbs' <- toYaml adverbs 115 115 return . mkTagNode "tag:pugs:Rule" $ YamlMap
