Changeset 13903 for src/Pugs/Prim/Match.hs
- Timestamp:
- 10/05/06 06:25:21 (2 years ago)
- Files:
-
- 1 modified
-
src/Pugs/Prim/Match.hs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Prim/Match.hs
r13744 r13903 136 136 op2Match x (VType (mkType name)) 137 137 138 op2Match x (VSubst (rx, subst)) | rxGlobal rx = do 138 -- $x ~~ tr/x/y/ ==> $x = ~$x.trans('x' => 'y') 139 op2Match x (VSubst (MkTrans from to)) = do 140 str <- fromVal x 141 evalExp $ Syn "=" 142 [ Val x 143 , App (_Var "&trans") (Just (Val (VStr str))) 144 [ App (_Var "&infix:=>") Nothing 145 [ Val (VStr from) 146 , Val (VStr to) 147 ] 148 ] 149 ] 150 151 op2Match x (VSubst (MkSubst rx subst)) | rxGlobal rx = do 139 152 str <- fromVal x 140 153 (str', cnt) <- doReplace str 0 … … 162 175 return (concat [genericTake from str, str', after'], ok') 163 176 164 op2Match x (VSubst ( rx,subst)) = do177 op2Match x (VSubst (MkSubst rx subst)) = do 165 178 str <- fromVal x 166 179 ref <- fromVal x
