Changeset 11938 for third-party

Show
Ignore:
Timestamp:
08/06/06 08:04:18 (2 years ago)
Author:
audreyt
Message:

* HsSyck?: Chase up fps-0.7 changes.

Location:
third-party/HsSyck
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • third-party/HsSyck/Data/Yaml/Syck.hsc

    r11614 r11938  
    2222import GHC.Ptr (Ptr(..)) 
    2323import qualified Data.HashTable as Hash 
    24 import qualified Data.ByteString as Buf 
    25 import qualified Data.ByteString.Char8 as Char8 
     24import qualified Data.ByteString.Char8 as Buf 
    2625 
    2726type Buf        = Buf.ByteString 
     
    7473{-# INLINE unpackBuf #-} 
    7574unpackBuf :: Buf -> String 
    76 unpackBuf = Char8.unpack 
     75unpackBuf = Buf.unpack 
    7776 
    7877{-# INLINE packBuf #-} 
    7978packBuf :: String -> Buf 
    80 packBuf = Char8.pack 
     79packBuf = Buf.pack 
    8180 
    8281tagNode :: YamlTag -> YamlNode -> YamlNode 
     
    172171        syck_emit_scalar e tag scalarNone 0 0 0 (Ptr "~"##) 1 
    173172 
    174 emitNode _ e n | EStr s <- n_elem n, Buf.length s == 1, Buf.head s == 0x7E = do 
     173emitNode _ e n | EStr s <- n_elem n, Buf.length s == 1, Buf.head s == '~' = do 
    175174    withTag n (Ptr "string"##) $ \tag -> 
    176175        syck_emit_scalar e tag scalar1quote 0 0 0 (Ptr "~"##) 1 
     
    178177emitNode _ e n | EStr s <- n_elem n = do 
    179178    withTag n (Ptr "string"##) $ \tag -> 
    180         Buf.unsafeUseAsCStringLen s $ \(cs, l) ->        
     179        Buf.useAsCStringLen s $ \(cs, l) ->        
    181180        syck_emit_scalar e tag scalarNone 0 0 0 cs (toEnum l) 
    182181 
     
    287286    if (tag == nullPtr) then (return Nothing) else do 
    288287        p <- Buf.copyCString tag 
    289         return $! case Buf.elemIndex 0x2F p of -- '/' 
     288        return $! case Buf.elemIndex '/' p of 
    290289            Just n -> let { pre = Buf.take n p; post = Buf.drop (n+1) p } in 
    291290                Just $ Buf.concat [_tagLiteral, pre, _colonLiteral, post] 
     
    325324    buf   <- Buf.copyCStringLen (cstr, fromEnum len) 
    326325    let node = nilNode{ n_elem = EStr buf, n_tag = tag } 
    327     if tag == Nothing && Buf.length buf == 1 && Buf.index buf 0 == 0x7E 
     326    if tag == Nothing && Buf.length buf == 1 && Buf.index buf 0 == '~' 
    328327        then do 
    329328            style <- syck_str_style syckNode 
  • third-party/HsSyck/HsSyck.cabal

    r11614 r11938  
    11Name:                pugs-HsSyck 
    2 Version:             0.2 
     2Version:             0.3 
    33Description:         Fast, lightweight YAML loader and dumper 
    44-- License is really "MIT", but Cabal allows no such field 
     
    77Author:              Audrey Tang 
    88Maintainer:          audreyt@audreyt.org 
    9 Build-Depends:       base, pugs-fps 
     9Build-Depends:       base, pugs-fps >= 0.7 
    1010Exposed-modules:     Data.Yaml.Syck 
    1111extensions:          ForeignFunctionInterface 
    12 ghc-options:         -fglasgow-exts -O -optc-O2 -optc-w -funbox-strict-fields -fno-warn-orphans 
     12ghc-options:         -fglasgow-exts -O2 -optc-w -funbox-strict-fields -fno-warn-orphans 
    1313c-sources:           syck/bytecode.c syck/emitter.c syck/gram.c syck/handler.c 
    1414                     syck/implicit.c syck/node.c syck/syck.c syck/syck_st.c syck/token.c