Changeset 9647 for src/Pugs/Prim/Yaml.hs

Show
Ignore:
Timestamp:
03/18/06 16:40:38 (3 years ago)
Author:
gaal
svk:copy_cache_prev:
12197
Message:

* unbreak YAML object serialization. You may need to make clean

after applying this patch. Rule serialization is still broken.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Prim/Yaml.hs

    r9309 r9647  
    4242            hv      <- liftSTM $ (newTVar (Map.fromList vals) :: STM IHash) 
    4343            return $ VRef (hashRef hv) 
    44         Just s | Just (pre, post) <- Str.breakFirst ':' s 
    45                , pre == Str.pack "pugs/Object" -> do 
     44        Just s | (pre, post) <- Str.splitAt 16 s   -- 16 == length "tag:pugs:Object:" 
     45               , pre == Str.pack "tag:pugs:Object:" -> do 
    4646            let typ = Str.unpack post 
    4747            vals    <- forM nodes $ \(keyNode, valNode) -> do 
     
    5050                return (key, val) 
    5151            return . VObject =<< createObject (mkType typ) vals 
    52         Just s | s == Str.pack "pugs/Rule" -> do 
     52        Just s | s == Str.pack "tag:pugs:Rule" -> do 
    5353            vals    <- forM nodes $ \(keyNode, valNode) -> do 
    5454                key <- fromVal =<< fromYaml keyNode 
     
    110110    hash    <- fromVal v :: Eval VHash 
    111111    attrs   <- toYaml $ VRef (hashRef hash) 
    112     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 
     112    return $ tagNode (Just $ Str.pack $ "tag:pugs:Object:" ++ showType (objType obj)) attrs 
     113toYaml (VRule MkRulePGE{rxRule=rule, rxGlobal=global, rxStringify=stringify, rxAdverbs=adverbs}) = do 
    114114    adverbs' <- toYaml adverbs 
    115115    return . mkTagNode "tag:pugs:Rule" $ YamlMap