1
0
forked from GitHub/gf-core

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.)
This commit is contained in:
hallgren
2013-01-29 14:59:16 +00:00
parent 4d2de24ce9
commit 79795cb0e7

View File

@@ -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])