diff options
| author | kr.angelov <kr.angelov@gmail.com> | 2014-09-01 14:51:20 +0000 |
|---|---|---|
| committer | kr.angelov <kr.angelov@gmail.com> | 2014-09-01 14:51:20 +0000 |
| commit | bfd414554d2bb114baa8acc176744d55367eabb3 (patch) | |
| tree | af45ecfb78b0b6377444c96c19604e068fbc38f1 /src/compiler/GF/Compile/GrammarToPGF.hs | |
| parent | 342f6e3797db83a5ca48c179f4c7de436cacdb7d (diff) | |
partial implementation for recursive def rules
Diffstat (limited to 'src/compiler/GF/Compile/GrammarToPGF.hs')
| -rw-r--r-- | src/compiler/GF/Compile/GrammarToPGF.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler/GF/Compile/GrammarToPGF.hs b/src/compiler/GF/Compile/GrammarToPGF.hs index 6373133d7..c5a04230b 100644 --- a/src/compiler/GF/Compile/GrammarToPGF.hs +++ b/src/compiler/GF/Compile/GrammarToPGF.hs @@ -48,7 +48,7 @@ mkCanon2pgf opts gr am = do flags = Map.fromList [(mkCId f,x) | (f,x) <- optionsPGF aflags] - funs = Map.fromList [(i2i f, (mkType [] ty, arity, mkDef arity mdef, 0)) | + funs = Map.fromList [(i2i f, (mkType [] ty, arity, mkDef gr arity mdef, 0)) | ((m,f),AbsFun (Just (L _ ty)) ma mdef _) <- adefs, let arity = mkArrity ma ty] @@ -145,10 +145,10 @@ mkContext scope hyps = mapAccumL (\scope (bt,x,ty) -> let ty' = mkType scope ty then ( scope,(bt,i2i x,ty')) else (x:scope,(bt,i2i x,ty'))) scope hyps -mkDef arity (Just eqs) = Just ([C.Equ ps' (mkExp scope' e) | L _ (ps,e) <- eqs, let (scope',ps') = mapAccumL mkPatt [] ps] - ,generateByteCode arity eqs +mkDef gr arity (Just eqs) = Just ([C.Equ ps' (mkExp scope' e) | L _ (ps,e) <- eqs, let (scope',ps') = mapAccumL mkPatt [] ps] + ,generateByteCode gr arity eqs ) -mkDef arity Nothing = Nothing +mkDef gr arity Nothing = Nothing mkArrity (Just a) ty = a mkArrity Nothing ty = let (ctxt, _, _) = GM.typeForm ty |
