mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 11:42:49 -06:00
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:
@@ -162,7 +162,8 @@ unfactor t = CM (\gr c -> c (unfac gr t))
|
|||||||
T (TTyped ty) _ -> -- convertTerm doesn't handle these tables
|
T (TTyped ty) _ -> -- convertTerm doesn't handle these tables
|
||||||
ppbug $
|
ppbug $
|
||||||
sep [text "unfactor"<+>ppTerm Unqualified 10 t,
|
sep [text "unfactor"<+>ppTerm Unqualified 10 t,
|
||||||
text (show t)]
|
text (show t){-,
|
||||||
|
fsep (map (ppTerm Unqualified 10) (allparams ty))-}]
|
||||||
_ -> composSafeOp (unfac gr) t
|
_ -> composSafeOp (unfac gr) t
|
||||||
where
|
where
|
||||||
allparams ty = err bug id (allParamValues gr ty)
|
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
|
| l `elem` map fst rs2 = convertTerm opts sel ctype t2
|
||||||
| otherwise = convertTerm opts sel ctype t1
|
| 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
|
convertTerm opts CNil ctype t = do v <- evalTerm CNil t
|
||||||
return (CPar v)
|
return (CPar v)
|
||||||
convertTerm _ sel _ t = ppbug (text "convertTerm" <+> sep [parens (text (show sel)),ppTerm Unqualified 10 t])
|
convertTerm _ sel _ t = ppbug (text "convertTerm" <+> sep [parens (text (show sel)),ppTerm Unqualified 10 t])
|
||||||
|
|||||||
Reference in New Issue
Block a user