Changeset 16610

Show
Ignore:
Timestamp:
06/02/07 10:42:42 (18 months ago)
Author:
gaal
Message:

* factor out a function for fresh envDebug maps

Location:
src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs.hs

    r16605 r16610  
    6363run' :: (?debugInfo :: DebugInfo) => [String] -> IO () 
    6464run' ("-d":rest)                 = do 
    65     info <- fmap Just (io $ newTVarIO Map.empty) 
     65    info <- newDebugInfo 
    6666    let ?debugInfo = info 
    6767    run' rest 
     
    332332                else return menv 
    333333        debug <- if runOptDebug opts 
    334                 then fmap Just (io $ newTVarIO Map.empty) 
     334                then newDebugInfo 
    335335                else return Nothing 
    336336        stm $ modifyTVar ref $ \e -> e{ envDebug = debug } 
  • src/Pugs/AST/Internals.hs

    r16412 r16610  
    8989    anyToVal, vvToVal, anyFromVal, -- for circularity 
    9090 
    91     DebugInfo, _Sym, _Var -- String -> ByteString constructors 
     91    DebugInfo, newDebugInfo, _Sym, _Var -- String -> ByteString constructors 
    9292) where 
    9393 
     
    13341334 
    13351335type DebugInfo = Maybe (TVar (Map ID String)) 
     1336 
     1337newDebugInfo :: IO DebugInfo 
     1338newDebugInfo = fmap Just (io $ newTVarIO Map.empty) 
    13361339 
    13371340type LexPads = [LexPad]