From 54f04ecb5a8a4c91c5117a1437126df06e6a16bc Mon Sep 17 00:00:00 2001 From: aarne Date: Sat, 11 Dec 2010 16:27:35 +0000 Subject: [PATCH] fixed the failure to partial-evaluate pre in right-associative context --- src/compiler/GF/Compile/Compute/Concrete.hs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/compiler/GF/Compile/Compute/Concrete.hs b/src/compiler/GF/Compile/Compute/Concrete.hs index 535bb9fcd..830a86c25 100644 --- a/src/compiler/GF/Compile/Compute/Concrete.hs +++ b/src/compiler/GF/Compile/Compute/Concrete.hs @@ -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' ]