From 14c8da214cf7c97394b93bb37a92f94fca6c13d1 Mon Sep 17 00:00:00 2001 From: hallgren Date: Tue, 29 Jan 2013 14:59:16 +0000 Subject: [PATCH] Fix a bug with record extension MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a conversion rule for ({ l1 = e } ** x).l2 in PMCFG generation. (A rule for the symmetric case (x ** { l1 = e }).l2 was added some time ago.) --- src/compiler/GF/Compile/GeneratePMCFG.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/compiler/GF/Compile/GeneratePMCFG.hs b/src/compiler/GF/Compile/GeneratePMCFG.hs index b6619674c..d1765729e 100644 --- a/src/compiler/GF/Compile/GeneratePMCFG.hs +++ b/src/compiler/GF/Compile/GeneratePMCFG.hs @@ -162,7 +162,8 @@ unfactor t = CM (\gr c -> c (unfac gr t)) T (TTyped ty) _ -> -- convertTerm doesn't handle these tables ppbug $ sep [text "unfactor"<+>ppTerm Unqualified 10 t, - text (show t)] + text (show t){-, + fsep (map (ppTerm Unqualified 10) (allparams ty))-}] _ -> composSafeOp (unfac gr) t where allparams ty = err bug id (allParamValues gr ty) @@ -384,6 +385,10 @@ convertTerm opts sel@(CProj l _) ctype (ExtR t1 t2@(R rs2)) | l `elem` map fst rs2 = convertTerm opts sel ctype t2 | otherwise = convertTerm opts sel ctype t1 +convertTerm opts sel@(CProj l _) ctype (ExtR t1@(R rs1) t2) + | l `elem` map fst rs1 = convertTerm opts sel ctype t1 + | otherwise = convertTerm opts sel ctype t2 + convertTerm opts CNil ctype t = do v <- evalTerm CNil t return (CPar v) convertTerm _ sel _ t = ppbug (text "convertTerm" <+> sep [parens (text (show sel)),ppTerm Unqualified 10 t])