Changeset 7925 for src/Pugs/Prim/Match.hs
- Timestamp:
- 11/10/05 18:33:20 (3 years ago)
- Files:
-
- 1 modified
-
src/Pugs/Prim/Match.hs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Prim/Match.hs
r7879 r7925 10 10 import Pugs.Types 11 11 import Pugs.Config 12 import Pugs.Prim.Code 12 13 import qualified RRegex.PCRE as PCRE 13 14 import qualified Data.Map as Map … … 82 83 op2Match :: Val -> Val -> Eval Val 83 84 85 op2Match _ y@(VCode _) = do 86 (arity :: Int) <- fromVal =<< op1CodeArity y 87 res <- fromVal =<< case arity of 88 0 -> evalExp $ App (Val y) Nothing [] 89 1 -> do 90 topic <- readVar "$_" 91 evalExp $ App (Val y) Nothing [Val topic] 92 _ -> fail ("Unexpected arity in smart match: " ++ (show arity)) 93 return $ VBool $ res 94 84 95 op2Match x (VRef (MkRef (IScalar sv))) | scalar_iType sv == mkType "Scalar::Const" = do 85 96 y' <- scalar_fetch' sv
