summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Compile/Compute
diff options
context:
space:
mode:
authoraarne <aarne@chalmers.se>2010-12-11 16:27:35 +0000
committeraarne <aarne@chalmers.se>2010-12-11 16:27:35 +0000
commit9b5223a06b39aee18066a626867631db32cf989b (patch)
treeef1d419f311892553f0bb1d3785510af2b374780 /src/compiler/GF/Compile/Compute
parent1ed5b52a038e3a77a74433b9b3eaf21ac1c5e25b (diff)
fixed the failure to partial-evaluate pre in right-associative context
Diffstat (limited to 'src/compiler/GF/Compile/Compute')
-rw-r--r--src/compiler/GF/Compile/Compute/Concrete.hs11
1 files 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'
]