From aa9280b2870e4e60280327dfd8a493d2b83f69ba Mon Sep 17 00:00:00 2001 From: hallgren Date: Tue, 10 Sep 2013 13:43:59 +0000 Subject: [PATCH] Workaround for a problem with lock fields This problem showed up after delaing eta expansion until just before partial evaluation --- src/compiler/GF/Compile/GeneratePMCFG.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/compiler/GF/Compile/GeneratePMCFG.hs b/src/compiler/GF/Compile/GeneratePMCFG.hs index 698bf3d5c..8ff42f6ef 100644 --- a/src/compiler/GF/Compile/GeneratePMCFG.hs +++ b/src/compiler/GF/Compile/GeneratePMCFG.hs @@ -20,6 +20,7 @@ import GF.Infra.Option import GF.Grammar hiding (Env, mkRecord, mkTable) import GF.Grammar.Lookup import GF.Grammar.Predef +import GF.Grammar.Lockfield (isLockLabel) import GF.Data.BacktrackM import GF.Data.Operations import GF.Infra.UseIO (IOE) @@ -438,7 +439,8 @@ convertArg opts ty nr path = do return (CPar value) convertRec opts CNil (RecType rs) record = - mkRecord (map (\(lbl,ctype) -> (lbl,convertTerm opts CNil ctype (projectRec lbl record))) rs) + mkRecord [(lbl,convertTerm opts CNil ctype (proj lbl))|(lbl,ctype)<-rs] + where proj lbl = if isLockLabel lbl then R [] else projectRec lbl record convertRec opts (CProj lbl path) ctype record = convertTerm opts path ctype (projectRec lbl record) convertRec opts _ ctype _ = bug ("convertRec: "++show ctype)