diff options
author | johnvg | 2013-04-02 15:26:26 +0000 |
---|---|---|
committer | johnvg | 2013-04-02 15:26:26 +0000 |
commit | d4e397a35be100674c23b2c863210136d5b5d35c (patch) | |
tree | e314addf40d5e1b8ea31701a80dc2435d7ac2b90 /frontend/frontend.icl | |
parent | in function adjust_type_code, add alternative for TCE_Selector, (diff) |
add type constraints in constructors and function arguments with universal quantifier (from iTask branch)
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@2218 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend/frontend.icl')
-rw-r--r-- | frontend/frontend.icl | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/frontend/frontend.icl b/frontend/frontend.icl index 8bac21b..e22dfdd 100644 --- a/frontend/frontend.icl +++ b/frontend/frontend.icl @@ -1,6 +1,3 @@ - /* - module owner: Ronny Wichers Schreur -*/ implementation module frontend import scanner, parse, postparse, check, type, trans, partition, convertcases, overloading, utilities, convertDynamics, @@ -347,17 +344,42 @@ showMacrosInModule dcl_index (macro_defs,file) # (macro,macro_defs) = macro_defs![dcl_index,macro_index] = (macro_defs, file <<< macro_index <<< macro <<< '\n') -showComponents :: !u:{! Group} !Int !Bool !*{# FunDef} !*File -> (!u:{! Group}, !*{# FunDef},!*File) +showGroups :: !u:{! Group} !Int !Bool !*{# FunDef} !*File -> (!u:{! Group}, !*{# FunDef},!*File) +showGroups comps comp_index show_types fun_defs file + | comp_index >= size comps + = (comps, fun_defs, file) + # (comp, comps) = comps![comp_index] + # (fun_defs, file) = show_group comp.group_members show_types fun_defs (file <<< "component " <<< comp_index <<< '\n') + = showGroups comps (inc comp_index) show_types fun_defs file + +show_group [] show_types fun_defs file + = (fun_defs, file <<< '\n') +show_group [fun:funs] show_types fun_defs file + # (fun_def, fun_defs) = fun_defs![fun] + # file=file<<<fun<<<'\n' + | show_types + = show_group funs show_types fun_defs (file <<< fun_def.fun_type <<< '\n' <<< fun_def) + = show_group funs show_types fun_defs (file <<< fun_def) +// = show_group funs show_types fun_defs (file <<< fun_def.fun_ident) + +showComponents :: !u:{!Component} !Int !Bool !*{# FunDef} !*File -> (!u:{!Component}, !*{# FunDef},!*File) showComponents comps comp_index show_types fun_defs file | comp_index >= size comps = (comps, fun_defs, file) # (comp, comps) = comps![comp_index] - # (fun_defs, file) = show_component comp.group_members show_types fun_defs (file <<< "component " <<< comp_index <<< '\n') + # (fun_defs, file) = show_component comp.component_members show_types fun_defs (file <<< "component " <<< comp_index <<< '\n') = showComponents comps (inc comp_index) show_types fun_defs file -show_component [] show_types fun_defs file +show_component NoComponentMembers show_types fun_defs file = (fun_defs, file <<< '\n') -show_component [fun:funs] show_types fun_defs file +show_component (ComponentMember fun funs) show_types fun_defs file + # (fun_def, fun_defs) = fun_defs![fun] + # file=file<<<fun<<<'\n' + | show_types + = show_component funs show_types fun_defs (file <<< fun_def.fun_type <<< '\n' <<< fun_def) + = show_component funs show_types fun_defs (file <<< fun_def) +// = show_component funs show_types fun_defs (file <<< fun_def.fun_ident) +show_component (GeneratedComponentMember fun _ funs) show_types fun_defs file # (fun_def, fun_defs) = fun_defs![fun] # file=file<<<fun<<<'\n' | show_types |