aboutsummaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
Diffstat (limited to 'frontend')
-rw-r--r--frontend/convertDynamics.icl4
-rw-r--r--frontend/type_io_common.dcl6
-rw-r--r--frontend/type_io_common.icl10
3 files changed, 15 insertions, 5 deletions
diff --git a/frontend/convertDynamics.icl b/frontend/convertDynamics.icl
index 0a86829..16badfc 100644
--- a/frontend/convertDynamics.icl
+++ b/frontend/convertDynamics.icl
@@ -98,7 +98,7 @@ write_tcl_file main_dcl_module_n dcl_mods=:{[main_dcl_module_n] = main_dcl_modul
= (True,tcl_file,type_heaps,predefined_symbols)
where
- collect_type_constructors_in_dynamic_patterns :: !Int !Int [(!TypeSymbIdent,!String)] -> [(!TypeSymbIdent,!String)]
+ collect_type_constructors_in_dynamic_patterns :: !Int !Int [TypeSymbIdent] -> [TypeSymbIdent]
collect_type_constructors_in_dynamic_patterns i limit type_constructors_in_dynamic_patterns
| i == limit
= type_constructors_in_dynamic_patterns
@@ -107,7 +107,7 @@ where
# (GTT_Constructor type_name=:{type_name={id_name}} module_name used_in_application_of_type_dependent_function)
= global_type_instances.[i]
| used_in_application_of_type_dependent_function || ci_type_constructor_used_in_dynamic_patterns.[i]
- = collect_type_constructors_in_dynamic_patterns (inc i) limit [(type_name,module_name):type_constructors_in_dynamic_patterns]
+ = collect_type_constructors_in_dynamic_patterns (inc i) limit [type_name:type_constructors_in_dynamic_patterns]
= collect_type_constructors_in_dynamic_patterns (inc i) limit type_constructors_in_dynamic_patterns
= collect_type_constructors_in_dynamic_patterns (inc i) limit type_constructors_in_dynamic_patterns
where
diff --git a/frontend/type_io_common.dcl b/frontend/type_io_common.dcl
index 452244c..8a285da 100644
--- a/frontend/type_io_common.dcl
+++ b/frontend/type_io_common.dcl
@@ -74,10 +74,14 @@ isPredefinedModuleName name :== name == PredefinedModuleName
UnderscoreSystemModule :== "_system" // implements the predefined module
LowLevelInterfaceModule :== "StdDynamicLowLevelInterface"
+
+FunctionTypeConstructorAsString :== " -> "
instance toString GlobalTCType
create_type_string type_name module_name
- :== type_name +++ (APPEND_DEFINING_TYPE_MODULE_NAMES_TO_TYPE_NAMES ("'" +++ module_name ) "")
+ :== if (type_name == FunctionTypeConstructorAsString)
+ type_name
+ (type_name +++ (APPEND_DEFINING_TYPE_MODULE_NAMES_TO_TYPE_NAMES ("'" +++ module_name ) ""))
get_type_name_and_module_name_from_type_string :: !String -> (!String,!String)
diff --git a/frontend/type_io_common.icl b/frontend/type_io_common.icl
index a994110..2b406fe 100644
--- a/frontend/type_io_common.icl
+++ b/frontend/type_io_common.icl
@@ -75,15 +75,19 @@ UnderscoreSystemModule :== "_system" // implements the predefined module
LowLevelInterfaceModule :== "StdDynamicLowLevelInterface"
+FunctionTypeConstructorAsString :== " -> "
+
instance toString GlobalTCType
where
toString (GTT_Basic basic_type) = create_type_string (toString basic_type) PredefinedModuleName
- toString GTT_Function = " -> "
+ toString GTT_Function = FunctionTypeConstructorAsString
toString (GTT_Constructor type_symb_indent mod_name _) = create_type_string type_symb_indent.type_name.id_name mod_name
// +++ (APPEND_DEFINING_TYPE_MODULE_NAMES_TO_TYPE_NAMES ("'" +++ mod_name) "")
create_type_string type_name module_name
- :== type_name +++ (APPEND_DEFINING_TYPE_MODULE_NAMES_TO_TYPE_NAMES ("'" +++ module_name ) "")
+ :== if (type_name == FunctionTypeConstructorAsString)
+ type_name
+ (type_name +++ (APPEND_DEFINING_TYPE_MODULE_NAMES_TO_TYPE_NAMES ("'" +++ module_name ) ""))
get_type_name_and_module_name_from_type_string :: !String -> (!String,!String)
get_type_name_and_module_name_from_type_string type_string
@@ -95,6 +99,8 @@ get_type_name_and_module_name_from_type_string type_string
#! module_name
= type_string % (inc sep_pos,dec (size type_string))
= (type_name,module_name)
+ | type_string == FunctionTypeConstructorAsString
+ = (type_string,PredefinedModuleName)
where
CharIndex :: !String !Int !Char -> (!Bool,!Int)
CharIndex s i char