From 06a9755549c194ed39245152f66d81f43e2d9719 Mon Sep 17 00:00:00 2001 From: johnvg Date: Fri, 5 Apr 2013 14:31:26 +0000 Subject: add derive class for deriving generic functions in class context (from iTask branch) git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@2225 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d --- frontend/postparse.icl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'frontend/postparse.icl') diff --git a/frontend/postparse.icl b/frontend/postparse.icl index fb733cf..6af58be 100644 --- a/frontend/postparse.icl +++ b/frontend/postparse.icl @@ -365,6 +365,8 @@ instance collectFunctions GenericCaseDef where = ({gc & gc_gcf = GCF gc_ident {gcf & gcf_body=GCB_FunDef fun_def}}, ca) collectFunctions gc=:{gc_gcf=GCF _ {gcf_body=GCB_None}} icl_module ca = (gc, ca) + collectFunctions gc=:{gc_gcf=GCFC _ _} icl_module ca + = (gc, ca) instance collectFunctions FunDef where collectFunctions fun_def=:{fun_body = ParsedBody bodies} icl_module ca @@ -1194,7 +1196,7 @@ collectFunctionBodies fun_name fun_arity fun_prio fun_kind defs ca collectGenericBodies :: ![ParsedDefinition] !Ident !Int !TypeCons !*CollectAdmin -> (![ParsedBody], ![ParsedDefinition],!*CollectAdmin) collectGenericBodies all_defs=:[PD_GenericCase gc=:{gc_gcf=GCF gc_ident2 gcf} : defs] gc_ident1 gcf_arity1 gc_type_cons1 ca - | gc_ident2==gc_ident1 && gc.gc_type_cons == gc_type_cons1 + | gc_ident2==gc_ident1 && gc.gc_type_cons==gc_type_cons1 #! (bodies, rest_defs, ca) = collectGenericBodies defs gc_ident1 gcf_arity1 gc_type_cons1 ca # (GCF _ {gcf_body=GCB_ParsedBody args rhs,gcf_arity}) = gc.gc_gcf #! body = {pb_args = args, pb_rhs = rhs, pb_position = gc.gc_pos} -- cgit v1.2.3