an alternative lookup strategy in Compute

This commit is contained in:
aarne
2006-11-13 17:52:58 +00:00
parent 49c8a52ade
commit ae4ba74838

View File

@@ -17,6 +17,7 @@ module GF.Grammar.Compute (computeConcrete, computeTerm,computeConcreteRec) wher
import GF.Data.Operations import GF.Data.Operations
import GF.Grammar.Grammar import GF.Grammar.Grammar
import GF.Infra.Ident import GF.Infra.Ident
import GF.Infra.Option
import GF.Data.Str import GF.Data.Str
import GF.Grammar.PrGrammar import GF.Grammar.PrGrammar
import GF.Infra.Modules import GF.Infra.Modules
@@ -287,6 +288,19 @@ computeTermOpt rec gr = comp where
| rec = lookupResDef gr p c >>= comp [] | rec = lookupResDef gr p c >>= comp []
| otherwise = lookupResDef gr p c | otherwise = lookupResDef gr p c
{-
look p c = case lookupResDefKind gr p c of
Ok (t,_) | noExpand p || rec -> comp [] t
Ok (t,_) -> return t
Bad s -> raise s
noExpand p = errVal False $ do
mo <- lookupModMod gr p
return $ case getOptVal (iOpts (flags mo)) useOptimizer of
Just "noexpand" -> True
_ -> False
-}
ext x a g = (x,a):g ext x a g = (x,a):g
returnC = return --- . computed returnC = return --- . computed