From c30e2df228fc42653149752b56e50e77bae03b9f Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Mon, 11 Aug 2014 15:53:41 +0000 Subject: pattern matching in def rules is now supported --- src/compiler/GF/Compile/GrammarToPGF.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/compiler/GF/Compile') 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 -- cgit v1.2.3