forked from GitHub/gf-core
fixed a variable refreshing bug in the compiler
This commit is contained in:
@@ -60,6 +60,8 @@ refresh e = case e of
|
|||||||
|
|
||||||
T i cc -> liftM2 T (refreshTInfo i) (mapM refreshCase cc)
|
T i cc -> liftM2 T (refreshTInfo i) (mapM refreshCase cc)
|
||||||
|
|
||||||
|
App f a -> liftM2 App (inBlockSTM (refresh f)) (refresh a)
|
||||||
|
|
||||||
_ -> composOp refresh e
|
_ -> composOp refresh e
|
||||||
|
|
||||||
refreshCase :: (Patt,Term) -> STM IdState (Patt,Term)
|
refreshCase :: (Patt,Term) -> STM IdState (Patt,Term)
|
||||||
@@ -131,3 +133,14 @@ refreshModule (k,ms) mi@(i,mo)
|
|||||||
return $ (k', (c, CncFun mt (Just (L loc trm')) pn):cs)
|
return $ (k', (c, CncFun mt (Just (L loc trm')) pn):cs)
|
||||||
_ -> return (k, ci:cs)
|
_ -> return (k, ci:cs)
|
||||||
|
|
||||||
|
|
||||||
|
-- running monad and returning to initial state
|
||||||
|
|
||||||
|
inBlockSTM :: STM s a -> STM s a
|
||||||
|
inBlockSTM mo = do
|
||||||
|
s <- readSTM
|
||||||
|
v <- mo
|
||||||
|
writeSTM s
|
||||||
|
return v
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user