1
0
forked from GitHub/gf-core

fixed the failure to partial-evaluate pre in right-associative context

This commit is contained in:
aarne
2010-12-11 16:27:35 +00:00
parent 99c38bf070
commit 54f04ecb5a

View File

@@ -193,10 +193,17 @@ computeTermOpt rec gr = comput True where
a' <- comp g a
b' <- comp g b
case (a',b') of
(Alts _ _, K a) -> checks [do
(Alts _ _, K d) -> checks [do
as <- strsFromTerm a' -- this may fail when compiling opers
return $ variants [
foldr1 C (map K (str2strings (plusStr v (str a)))) | v <- as]
foldr1 C (map K (str2strings (plusStr v (str d)))) | v <- as]
,
return $ C a' b'
]
(Alts _ _, C (K d) e) -> checks [do
as <- strsFromTerm a' -- this may fail when compiling opers
return $ C (variants [
foldr1 C (map K (str2strings (plusStr v (str d)))) | v <- as]) e
,
return $ C a' b'
]