mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 19:42:50 -06:00
an alternative lookup strategy in Compute
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user