aboutsummaryrefslogtreecommitdiff
path: root/frontend/postparse.icl
diff options
context:
space:
mode:
authorronny2004-04-19 14:19:38 +0000
committerronny2004-04-19 14:19:38 +0000
commit46d10df341f0c1bbc5452dabea0210b2599039bb (patch)
tree260fde8c24e404fb771bc86df45dd91d6db8ebd4 /frontend/postparse.icl
parentmark lazy and/or curried entries of cons for list of unboxed records (diff)
remove TC; types
type constructors in dynamic types are now uniquely represented by the descriptor of their TD_ (type definition) function git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1486 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend/postparse.icl')
-rw-r--r--frontend/postparse.icl49
1 files changed, 2 insertions, 47 deletions
diff --git a/frontend/postparse.icl b/frontend/postparse.icl
index 85d5d91..a440111 100644
--- a/frontend/postparse.icl
+++ b/frontend/postparse.icl
@@ -1477,54 +1477,9 @@ reorganiseDefinitionsAndAddTypes mod_ident support_dynamics icl_module defs ca
, import_file_position = NoPos
}
# imports = if (mod_ident == clean_types_module_ident) [] [clean_types_module]
- # (rev_defs, ca)
- = addTypeConstructors defs [PD_Import imports] ca
- = reorganiseDefinitions icl_module (reverse rev_defs) 0 0 0 0 ca
+ = reorganiseDefinitions icl_module [PD_Import imports : defs] 0 0 0 0 ca
+ // otherwise
= reorganiseDefinitions icl_module defs 0 0 0 0 ca
- where
- addTypeConstructors [] rev_defs ca
- = (rev_defs, ca)
- addTypeConstructors [PD_Type type_def : defs] rev_defs ca
- # (type_def, tc_def, ca)
- = addTypeConstructor type_def ca
- = addTypeConstructors defs [PD_Type tc_def, PD_Type type_def : rev_defs] ca
- addTypeConstructors [def : defs] rev_defs ca
- = addTypeConstructors defs [def : rev_defs] ca
-
-addTypeConstructor def=:{td_ident, td_attribute, td_attrs, td_args, td_arity, td_pos} ca=:{ca_hash_table}
- # tc_name = "TC;" +++ td_ident.id_name
- # ({boxed_ident=tc_cons_ident}, ca_hash_table) = putIdentInHashTable tc_name IC_Expression ca_hash_table
- # ({boxed_ident=tc_type_ident}, ca_hash_table) = putIdentInHashTable tc_name IC_Type ca_hash_table
- = (def, type_tc_def tc_type_ident tc_cons_ident td_ident td_attribute td_attrs td_args
- td_arity td_pos, { ca & ca_hash_table = ca_hash_table })
- where
- type_tc_def ident cons_ident type_ident attr attrs args arity position
- = { td_ident = ident
- , td_index = NoIndex
- , td_arity = arity
- , td_args = args
- , td_attrs = attrs
- , td_context = []
- , td_rhs = ConsList [type_tc_cons cons_ident type_ident args arity position]
- , td_attribute = attr
- , td_pos = position
- , td_used_types = []
- , td_fun_index = NoIndex
- }
- type_tc_cons cons_ident type_ident args arity position
- = { pc_cons_ident = cons_ident
- , pc_cons_arity = 1
- , pc_exi_vars = []
- , pc_arg_types = [type type_ident args arity]
- , pc_args_strictness = NotStrict
- , pc_cons_prio = NoPrio
- , pc_cons_pos = position
- }
- type type_ident args arity
- = { at_attribute = TA_None
- , at_type = TA (MakeNewTypeSymbIdent type_ident arity)
- [{at_attribute = TA_None, at_type = TV arg.atv_variable} \\ arg <- args]
- }
belongsToTypeSpec name prio new_name is_infix :==
name == new_name && sameFixity prio is_infix