diff options
| author | hallgren <hallgren@chalmers.se> | 2013-01-29 14:59:16 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2013-01-29 14:59:16 +0000 |
| commit | 14c8da214cf7c97394b93bb37a92f94fca6c13d1 (patch) | |
| tree | 7a6ce1505aa4d0923a66650174057c3b531eb4ca /src/compiler/GF/Compile/GeneratePMCFG.hs | |
| parent | 211cd9bb25c7928b94976a9b8bb1124a0578b59e (diff) | |
Fix a bug with record extension
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.)
Diffstat (limited to 'src/compiler/GF/Compile/GeneratePMCFG.hs')
| -rw-r--r-- | src/compiler/GF/Compile/GeneratePMCFG.hs | 7 |
1 files changed, 6 insertions, 1 deletions
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]) |
