summaryrefslogtreecommitdiff
path: root/src/GF/Devel
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2007-11-12 12:36:40 +0000
committeraarne <aarne@cs.chalmers.se>2007-11-12 12:36:40 +0000
commit6158445114731a71295723718f7a673786b5e37a (patch)
treee63fba5a67669360d5605d5b6e01d1bf80d86a5f /src/GF/Devel
parentb801149fbf5c9eb3f73477d3496cdfd92cb178a1 (diff)
fixed bug with prawitz transform of course-of-values tables in Compute
Diffstat (limited to 'src/GF/Devel')
-rw-r--r--src/GF/Devel/GrammarToGFCC.hs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/GF/Devel/GrammarToGFCC.hs b/src/GF/Devel/GrammarToGFCC.hs
index 87709265f..877a9ee73 100644
--- a/src/GF/Devel/GrammarToGFCC.hs
+++ b/src/GF/Devel/GrammarToGFCC.hs
@@ -391,10 +391,15 @@ term2term cgr env@(labels,untyps,typs) tr = case tr of
--- this is mainly needed for parameter record projections
---- was: errVal t $ Compute.computeConcreteRec cgr t
comp t = case t of
- S (V typ ts) v0 -> errVal t $ do
+ T (TComp typ) ts -> comp $ V typ (map (comp . snd) ts) ---- should
+ T (TTyped typ) ts -> comp $ V typ (map (comp . snd) ts) ---- should
+ V typ ts -> V typ (map comp ts)
+ S (V typ ts) v0 -> err error id $ do
let v = comp v0
vs <- Look.allParamValues cgr typ
- return $ maybe t (comp . (ts !!)) $ lookup v (zip vs [0 .. length vs - 1])
+ return $ maybe t ---- (error (prt t)) -- should be safe after doVar though
+ (comp . (ts !!)) $ lookup v (zip vs [0 .. length vs - 1])
+ R r -> R [(l,(ty,comp t)) | (l,(ty,t)) <- r]
P (R r) l -> maybe t (comp . snd) $ lookup l r
_ -> GM.composSafeOp comp t
@@ -481,6 +486,6 @@ unlockTyp = filter notlock where
_ -> True
prtTrace tr n =
- trace ("-- INTERNAL COMPILER ERROR" +++ A.prt tr ++++ show tr ++++ show n) n
+ trace ("-- INTERNAL COMPILER ERROR" +++ A.prt tr ++++ show n) n
prTrace tr n = trace ("-- OBSERVE" +++ A.prt tr +++ show n +++ show tr) n