diff options
| author | John J. Camilleri <john@digitalgrammars.com> | 2021-07-01 13:53:33 +0200 |
|---|---|---|
| committer | John J. Camilleri <john@digitalgrammars.com> | 2021-07-01 13:53:33 +0200 |
| commit | 78b73fba20d45ed8c3f1c87455795fbf7d670950 (patch) | |
| tree | 09e6f46adab57e477071de6a6e0aab574702726b /src | |
| parent | e5a2aed5b6e31fe89e94e9fd9c22e2488f85cae8 (diff) | |
Make cleanupRecordFields also recurse into variants
It's possible that more constructors need to be handled
Diffstat (limited to 'src')
| -rw-r--r-- | src/compiler/GF/Compile/GrammarToCanonical.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/GF/Compile/GrammarToCanonical.hs b/src/compiler/GF/Compile/GrammarToCanonical.hs index 57a761a64..a600573ac 100644 --- a/src/compiler/GF/Compile/GrammarToCanonical.hs +++ b/src/compiler/GF/Compile/GrammarToCanonical.hs @@ -12,7 +12,7 @@ import GF.Data.ErrM import GF.Text.Pretty import GF.Grammar.Grammar as G import GF.Grammar.Lookup(lookupOrigInfo,allOrigInfos,allParamValues) -import GF.Grammar.Macros(typeForm,collectOp,collectPattOp,mkAbs,mkApp,term2patt,sortRec) +import GF.Grammar.Macros(typeForm,collectOp,collectPattOp,composSafeOp,mkAbs,mkApp,term2patt,sortRec) import GF.Grammar.Lockfield(isLockLabel) import GF.Grammar.Predef(cPredef,cInts) import GF.Compile.Compute.Predef(predef) @@ -163,6 +163,7 @@ cleanupRecordFields (RecType ls) (R as) = , let Just ty = M.lookup lbl defnFields , let t' = cleanupRecordFields ty t ] +cleanupRecordFields ty t@(FV _) = composSafeOp (cleanupRecordFields ty) t cleanupRecordFields _ t = t convert :: G.Grammar -> Term -> LinValue |
