1
0
forked from GitHub/gf-core

Fix an old name shadowing bug in concrete syntax by removing the refresh pass

The refresh pass does not correctly keep track of the scope of local variables
and can convert things like \x->(\x->x) x into \x1->(\x2->x2) x2. Fortunately,
it appears that the refresh pass is not needed anymore, so it has been removed.
This commit is contained in:
hallgren
2013-09-09 14:29:57 +00:00
parent 5a4454aa8f
commit 83283b0d6a
8 changed files with 20 additions and 17 deletions

View File

@@ -20,7 +20,7 @@ import GF.Data.Operations
import GF.Grammar.Grammar
import GF.Grammar.Printer
import GF.Infra.Ident
import GF.Compile.Refresh
--import GF.Compile.Refresh
import GF.Grammar.Values
----import GrammarST
import GF.Grammar.Macros
@@ -160,12 +160,12 @@ substitute v s = return . substTerm v s
alphaConv :: [Var] -> (Var,Var) -> Exp -> Err Exp ---
alphaConv oldvars (x,x') = substitute (x:x':oldvars) [(x,Vr x')]
alphaFresh :: [Var] -> Exp -> Err Exp
alphaFresh vs = refreshTermN $ maxVarIndex vs
--alphaFresh :: [Var] -> Exp -> Err Exp
--alphaFresh vs = refreshTermN $ maxVarIndex vs
-- | done in a state monad
alphaFreshAll :: [Var] -> [Exp] -> Err [Exp]
alphaFreshAll vs = mapM $ alphaFresh vs
--alphaFreshAll :: [Var] -> [Exp] -> Err [Exp]
--alphaFreshAll vs = mapM $ alphaFresh vs
-- | for display
val2exp :: Val -> Err Exp