1
0
forked from GitHub/gf-core

Remove unused function computeConcreteRec.

This also allows the parameter rec to be removed from function computeTermOpt.
(The change is made in GF.Compile.Compute.ConcreteLazy, but not in 
GF.Compile.Compute.ConcreteStrict.)
This commit is contained in:
hallgren
2011-09-09 12:25:27 +00:00
parent 8098f79941
commit 42ea96a5ca

View File

@@ -12,7 +12,7 @@
-- Computation of source terms. Used in compilation and in @cc@ command. -- Computation of source terms. Used in compilation and in @cc@ command.
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
module GF.Compile.Compute.ConcreteLazy (computeConcrete, computeTerm,computeConcreteRec,checkPredefError) where module GF.Compile.Compute.ConcreteLazy (computeConcrete, computeTerm,checkPredefError) where
import GF.Data.Operations import GF.Data.Operations
import GF.Grammar.Grammar import GF.Grammar.Grammar
@@ -50,17 +50,12 @@ runtime_error = return . predef_error -- run-time error term
-- used mainly for partial evaluation -- used mainly for partial evaluation
computeConcrete :: SourceGrammar -> Term -> Err Term computeConcrete :: SourceGrammar -> Term -> Err Term
computeConcrete g t = {- refreshTerm t >>= -} computeTerm g [] t computeConcrete g t = {- refreshTerm t >>= -} computeTerm g [] t
computeConcreteRec g t = {- refreshTerm t >>= -} computeTermOpt True g [] t
-- False means: no evaluation under Abs
computeTerm :: SourceGrammar -> Substitution -> Term -> Err Term computeTerm :: SourceGrammar -> Substitution -> Term -> Err Term
computeTerm gr g = return . runIdentity . computeTermOpt False gr g computeTerm gr g = return . runIdentity . computeTermOpt gr g
-- rec=True is used if it cannot be assumed that looked-up constants computeTermOpt :: SourceGrammar -> Substitution -> Term -> Comp Term
-- have already been computed (mainly with -optimize=noexpand in .gfr) computeTermOpt gr = comput True where
computeTermOpt :: Bool -> SourceGrammar -> Substitution -> Term -> Comp Term
computeTermOpt rec gr = comput True where
-- full = True means full evaluation under Abs -- full = True means full evaluation under Abs
comput full g t = ---- errIn ("subterm" +++ prt t) $ --- for debugging comput full g t = ---- errIn ("subterm" +++ prt t) $ --- for debugging
@@ -282,9 +277,7 @@ computeTermOpt rec gr = comput True where
hnf = comput False hnf = comput False
comp = comput True comp = comput True
look c look c = errr (lookupResDef gr c)
| rec = errr (lookupResDef gr c) >>= comp []
| otherwise = errr (lookupResDef gr c)
ext x a g = (x,a):g -- extend environment with new variable and its value ext x a g = (x,a):g -- extend environment with new variable and its value