Changeset 12317 for src/Pugs/Prim/Match.hs
- Timestamp:
- 08/16/06 19:28:24 (2 years ago)
- Files:
-
- 1 modified
-
src/Pugs/Prim/Match.hs (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Prim/Match.hs
r12176 r12317 37 37 let pwd = if hasSrc then pwd2 else pwd1 38 38 glob <- askGlobal 39 let syms = [ (name, tvar) | (('<':'*':name), [(_, tvar)]) <- padToList glob ] 39 let syms = [ (cast $ v_name var, tvar) 40 | (var, [(_, tvar)]) <- padToList glob 41 , SRegex == v_sigil var 42 , isGlobalVar var 43 ] 40 44 subrules <- forM syms $ \(name, tvar) -> do 41 45 ref <- liftSTM $ readTVar tvar … … 106 110 0 -> evalExp $ App (Val y) Nothing [] 107 111 1 -> do 108 topic <- readVar "$_"112 topic <- readVar (cast "$_") 109 113 evalExp $ App (Val y) Nothing [Val topic] 110 114 _ -> fail ("Unexpected arity in smart match: " ++ (show arity)) … … 142 146 if not (matchOk match) then return (str, ok) else do 143 147 glob <- askGlobal 144 matchSV <- findSymRef "$/"glob148 matchSV <- findSymRef (cast "$/") glob 145 149 writeRef matchSV (VMatch match) 146 150 str' <- fromVal =<< evalExp subst … … 161 165 if not (matchOk match) then return (VBool False) else do 162 166 glob <- askGlobal 163 matchSV <- findSymRef "$/"glob167 matchSV <- findSymRef (cast "$/") glob 164 168 writeRef matchSV (VMatch match) 165 169 str' <- fromVal =<< evalExp subst … … 205 209 match <- str `doMatch` rx 206 210 glob <- askGlobal 207 matchSV <- findSymRef "$/"glob211 matchSV <- findSymRef (cast "$/") glob 208 212 writeRef matchSV (VMatch match) 209 213 ifListContext … … 275 279 pkgParents :: VStr -> Eval [VStr] 276 280 pkgParents pkg = do 277 ref <- readVar (':':'*':pkg)281 ref <- readVar $ cast (':':'*':pkg) 278 282 if ref == undef then return [] else do 279 283 meta <- readRef =<< fromVal ref … … 287 291 pkgParentClasses :: VStr -> Eval [VStr] 288 292 pkgParentClasses pkg = do 289 ref <- readVar (':':'*':pkg)293 ref <- readVar $ cast (':':'*':pkg) 290 294 if ref == undef then return [] else do 291 295 meta <- readRef =<< fromVal ref
