@@ -49,7 +49,7 @@ elabType info syn fc n ty' = {- let ty' = piBind (params info) ty_in
49 ds <- checkDef fc ((n, nty):defer)
49 ds <- checkDef fc ((n, nty):defer)
50 addIBC (IBCDef n)
50 addIBC (IBCDef n)
51 addDeferred ds
51 addDeferred ds
52− mapM_ (elabDecl' info) is
52+ mapM_ (elabCaseBlock info) is
54elabData :: ElabInfo -> SyntaxInfo -> FC -> PData -> Idris ()
54elabData :: ElabInfo -> SyntaxInfo -> FC -> PData -> Idris ()
55elabData info syn fc (PDatadecl n t_in dcons)
55elabData info syn fc (PDatadecl n t_in dcons)
@@ -63,7 +63,7 @@ elabData info syn fc (PDatadecl n t_in dcons)
63 (erun fc (build i info False n t))
63 (erun fc (build i info False n t))
64 def' <- checkDef fc defer
64 def' <- checkDef fc defer
65 addDeferred def'
65 addDeferred def'
66− mapM_ (elabDecl' info) is
66+ mapM_ (elabCaseBlock info) is
67 (cty, _) <- recheckC ctxt fc [] t'
67 (cty, _) <- recheckC ctxt fc [] t'
68 logLvl 2 $ "---> " ++ show cty
68 logLvl 2 $ "---> " ++ show cty
69 updateContext (addTyDecl n cty) -- temporary, to check cons
69 updateContext (addTyDecl n cty) -- temporary, to check cons
@@ -85,7 +85,7 @@ elabCon info syn (n, t_in, fc)
85 logLvl 2 $ "Rechecking " ++ show t'
85 logLvl 2 $ "Rechecking " ++ show t'
86 def' <- checkDef fc defer
86 def' <- checkDef fc defer
87 addDeferred def'
87 addDeferred def'
88− mapM_ (elabDecl' info) is
88+ mapM_ (elabCaseBlock info) is
89 ctxt <- getContext
89 ctxt <- getContext
90 (cty, _) <- recheckC ctxt fc [] t'
90 (cty, _) <- recheckC ctxt fc [] t'
91 logLvl 2 $ "---> " ++ show n ++ " : " ++ show cty
91 logLvl 2 $ "---> " ++ show n ++ " : " ++ show cty
@@ -95,8 +95,8 @@ elabCon info syn (n, t_in, fc)
95elabClauses :: ElabInfo -> FC -> FnOpts -> Name -> [PClause] -> Idris ()
95elabClauses :: ElabInfo -> FC -> FnOpts -> Name -> [PClause] -> Idris ()
96elabClauses info fc opts n_in cs_in = let n = liftname info n_in in
96elabClauses info fc opts n_in cs_in = let n = liftname info n_in in
97 do let cs = genClauses cs_in
97 do let cs = genClauses cs_in
99 pats_in <- mapM (elabClause info fc (TCGen `elem` opts)) cs
98 pats_in <- mapM (elabClause info fc (TCGen `elem` opts)) cs
100 let pats = mapMaybe id pats_in
100 let pats = mapMaybe id pats_in
101 logLvl 3 (showSep "\n" (map (\ (l,r) ->
101 logLvl 3 (showSep "\n" (map (\ (l,r) ->
102 show l ++ " = " ++
102 show l ++ " = " ++
@@ -192,7 +192,7 @@ elabClause info fc tcgen (PClause fname lhs_in withs rhs_in whereblock)
192 when (not (null defer)) $ iLOG $ "DEFERRED " ++ show defer
192 when (not (null defer)) $ iLOG $ "DEFERRED " ++ show defer
193 def' <- checkDef fc defer
193 def' <- checkDef fc defer
194 addDeferred def'
194 addDeferred def'
195− mapM_ (elabDecl' info) is
195+ mapM_ (elabCaseBlock info) is
196 ctxt <- getContext
196 ctxt <- getContext
197 logLvl 5 $ "Rechecking"
197 logLvl 5 $ "Rechecking"
198 (crhs, crhsty) <- recheckC ctxt fc [] rhs'
198 (crhs, crhsty) <- recheckC ctxt fc [] rhs'
@@ -242,7 +242,7 @@ elabClause info fc tcgen (PWith fname lhs_in withs wval_in withblock)
242 return (tt, d, is))
242 return (tt, d, is))
243 def' <- checkDef fc defer
243 def' <- checkDef fc defer
244 addDeferred def'
244 addDeferred def'
245− mapM_ (elabDecl' info) is
245+ mapM_ (elabCaseBlock info) is
246 (cwval, cwvalty) <- recheckC ctxt fc [] (getInferTerm wval')
246 (cwval, cwvalty) <- recheckC ctxt fc [] (getInferTerm wval')
247 logLvl 3 ("With type " ++ show cwvalty ++ "\nRet type " ++ show ret_ty)
247 logLvl 3 ("With type " ++ show cwvalty ++ "\nRet type " ++ show ret_ty)
248 windex <- getName
248 windex <- getName
@@ -278,7 +278,7 @@ elabClause info fc tcgen (PWith fname lhs_in withs wval_in withblock)
278 return (tt, d, is))
278 return (tt, d, is))
279 def' <- checkDef fc defer
279 def' <- checkDef fc defer
280 addDeferred def'
280 addDeferred def'
281− mapM_ (elabDecl' info) is
281+ mapM_ (elabCaseBlock info) is
282 (crhs, crhsty) <- recheckC ctxt fc [] rhs'
282 (crhs, crhsty) <- recheckC ctxt fc [] rhs'
283 return $ Just (clhs, crhs)
283 return $ Just (clhs, crhs)
@@ -585,6 +585,9 @@ elabDecl' info (PInstance s f cs n ps t ds)
585 elabInstance info s f cs n ps t ds
585 elabInstance info s f cs n ps t ds
586elabDecl' info (PDirective i) = i
586elabDecl' info (PDirective i) = i
588+elabCaseBlock info d@(PClauses f o n ps)
588-- elabDecl' info (PImport i) = loadModule i
591-- elabDecl' info (PImport i) = loadModule i