summaryrefslogtreecommitdiff
path: root/src/compiler/GF
diff options
context:
space:
mode:
authorkr.angelov <kr.angelov@gmail.com>2014-08-11 15:53:41 +0000
committerkr.angelov <kr.angelov@gmail.com>2014-08-11 15:53:41 +0000
commitc30e2df228fc42653149752b56e50e77bae03b9f (patch)
tree582a3a4fcac1e65b39968506208a466df3ed486f /src/compiler/GF
parentd3b9652b81e3d43bfb0de9faf4aea578c60e5cc4 (diff)
pattern matching in def rules is now supported
Diffstat (limited to 'src/compiler/GF')
-rw-r--r--src/compiler/GF/Compile/GrammarToPGF.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler/GF/Compile/GrammarToPGF.hs b/src/compiler/GF/Compile/GrammarToPGF.hs
index f042d5f38..6373133d7 100644
--- a/src/compiler/GF/Compile/GrammarToPGF.hs
+++ b/src/compiler/GF/Compile/GrammarToPGF.hs
@@ -50,7 +50,7 @@ mkCanon2pgf opts gr am = do
funs = Map.fromList [(i2i f, (mkType [] ty, arity, mkDef arity mdef, 0)) |
((m,f),AbsFun (Just (L _ ty)) ma mdef _) <- adefs,
- let arity = mkArrity ma]
+ let arity = mkArrity ma ty]
cats = Map.fromList [(i2i c, (snd (mkContext [] cont),catfuns c, 0)) |
((m,c),AbsCat (Just (L _ cont))) <- adefs]
@@ -150,9 +150,9 @@ mkDef arity (Just eqs) = Just ([C.Equ ps' (mkExp scope' e) | L _ (ps,e) <- eqs,
)
mkDef arity Nothing = Nothing
-mkArrity (Just a) = a
-mkArrity Nothing = 0
-
+mkArrity (Just a) ty = a
+mkArrity Nothing ty = let (ctxt, _, _) = GM.typeForm ty
+ in length ctxt
genCncCats gr am cm cdefs =
let (index,cats) = mkCncCats 0 cdefs