Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-compiler-and-rts
compiler
Commits
f543bc26
Commit
f543bc26
authored
Feb 11, 2002
by
Diederik van Arkel
Browse files
class type variables bugfix
parent
37e9f391
Changes
2
Hide whitespace changes
Inline
Side-by-side
frontend/trans.dcl
View file @
f543bc26
...
...
@@ -15,15 +15,16 @@ analyseGroups :: !{# CommonDefs} !{#{#FunType}} !IndexRange !Int !Int !*{! Group
->
(!
CleanupInfo
,
!*{!
ConsClasses
},
!*{!
Group
},
!*{#
FunDef
},
!*
VarHeap
,
!*
ExpressionHeap
)
transformGroups
::
!
CleanupInfo
!
Int
!
Int
!*{!
Group
}
!*{#
FunDef
}
!*{!.
ConsClasses
}
!{#
CommonDefs
}
!{#
{#
FunType
}
}
!*
{#{#
Check
edType
Def
}}
!
ImportedConstructors
!*
TypeDefInfos
!*
VarHeap
!*
TypeHeaps
!*
ExpressionHeap
!
Bool
->
(!*{!
Group
},
!*{#
FunDef
},
!*
{#{#
Check
edType
Def
}}
,
!
ImportedConstructors
,
!*
VarHeap
,
!*
TypeHeaps
,
!*
ExpressionHeap
)
!*
Import
edType
s
!
ImportedConstructors
!*
TypeDefInfos
!*
VarHeap
!*
TypeHeaps
!*
ExpressionHeap
!
Bool
->
(!*{!
Group
},
!*{#
FunDef
},
!*
Import
edType
s
,
!
ImportedConstructors
,
!*
VarHeap
,
!*
TypeHeaps
,
!*
ExpressionHeap
)
partitionateFunctions
::
!*{#
FunDef
}
![
IndexRange
]
->
(!*{!
Group
},
!*{#
FunDef
})
::
ImportedConstructors
:==
[
Global
Index
]
::
ImportedFunctions
:==
[
Global
Index
]
::
ImportedFunctions
:==
[
Global
Index
]
::
ImportedTypes
:==
{#{#
CheckedTypeDef
}}
convertSymbolType
::
!
Bool
!{#
CommonDefs
}
!
SymbolType
!
Int
!*
{#{#
Check
edType
Def
}}
!
ImportedConstructors
!*
TypeHeaps
!*
VarHeap
->
(!
SymbolType
,
!*
{#{#
Check
edType
Def
}}
,
!
ImportedConstructors
,
!*
TypeHeaps
,
!*
VarHeap
)
convertSymbolType
::
!
Bool
!{#
CommonDefs
}
!
SymbolType
!
Int
!*
Import
edType
s
!
ImportedConstructors
!*
TypeHeaps
!*
VarHeap
->
(!
SymbolType
,
!*
Import
edType
s
,
!
ImportedConstructors
,
!*
TypeHeaps
,
!*
VarHeap
)
addTypesOfDictionaries
::
!{#
CommonDefs
}
![
TypeContext
]
![
AType
]
->
[
AType
]
frontend/trans.icl
View file @
f543bc26
...
...
@@ -1761,6 +1761,12 @@ where
=
unify
class_atype
arg_type
type_input
subst
type_heaps
|
not
succ
=
abort
(
"sanity check nr 93 in module trans failed
\n
"
--->(
class_atype
,
"
\n
"
,
arg_type
))
#
(
free_vars_and_types
,
type_heaps
)
=
mapSt
subFVT
free_vars_and_types
type_heaps
with
subFVT
(
fv
,
ty
)
th
#
(_,
ty`
,
th`
)
=
substitute
ty
th
=
((
fv
,
ty`
),
th`
)
=
(
mapAppend
(\({
var_info_ptr
,
var_name
},
_)
->
{
fv_name
=
var_name
,
fv_info_ptr
=
var_info_ptr
,
fv_def_level
=
NotALevel
,
fv_count
=
0
})
free_vars_and_types
vars
...
...
@@ -2609,11 +2615,12 @@ renewVariables exprs var_heap
::
ImportedConstructors
:==
[
Global
Index
]
::
ImportedFunctions
:==
[
Global
Index
]
::
ImportedFunctions
:==
[
Global
Index
]
::
ImportedTypes
:==
{#{#
CheckedTypeDef
}}
transformGroups
::
!
CleanupInfo
!
Int
!
Int
!*{!
Group
}
!*{#
FunDef
}
!*{!.
ConsClasses
}
!{#
CommonDefs
}
!{#
{#
FunType
}
}
!*
{#{#
Check
edType
Def
}}
!
ImportedConstructors
!*
TypeDefInfos
!*
VarHeap
!*
TypeHeaps
!*
ExpressionHeap
!
Bool
->
(!*{!
Group
},
!*{#
FunDef
},
!*
{#{#
Check
edType
Def
}}
,
!
ImportedConstructors
,
!*
VarHeap
,
!*
TypeHeaps
,
!*
ExpressionHeap
)
!*
Import
edType
s
!
ImportedConstructors
!*
TypeDefInfos
!*
VarHeap
!*
TypeHeaps
!*
ExpressionHeap
!
Bool
->
(!*{!
Group
},
!*{#
FunDef
},
!*
Import
edType
s
,
!
ImportedConstructors
,
!*
VarHeap
,
!*
TypeHeaps
,
!*
ExpressionHeap
)
transformGroups
cleanup_info
main_dcl_module_n
stdStrictLists_module_n
groups
fun_defs
cons_args
common_defs
imported_funs
imported_types
collected_imports
type_def_infos
var_heap
type_heaps
symbol_heap
compile_with_fusion
#!
nr_of_funs
=
size
fun_defs
...
...
@@ -2708,8 +2715,8 @@ transformGroups cleanup_info main_dcl_module_n stdStrictLists_module_n groups fu
get_root_case_mode
{
tb_rhs
=
Case
_}
=
RootCase
get_root_case_mode
_
=
NotRootCase
add_new_function_to_group
::
!{#
CommonDefs
}
!
FunctionHeap
!
FunctionInfoPtr
!(!*{!
Group
},
![
FunDef
],
!*
{#{#
Check
edType
Def
}}
,
!
ImportedConstructors
,
!*
TypeHeaps
,
!*
VarHeap
)
->
(!*{!
Group
},
![
FunDef
],
!*
{#{#
Check
edType
Def
}}
,
!
ImportedConstructors
,
!*
TypeHeaps
,
!*
VarHeap
)
add_new_function_to_group
::
!{#
CommonDefs
}
!
FunctionHeap
!
FunctionInfoPtr
!(!*{!
Group
},
![
FunDef
],
!*
Import
edType
s
,
!
ImportedConstructors
,
!*
TypeHeaps
,
!*
VarHeap
)
->
(!*{!
Group
},
![
FunDef
],
!*
Import
edType
s
,
!
ImportedConstructors
,
!*
TypeHeaps
,
!*
VarHeap
)
add_new_function_to_group
common_defs
ti_fun_heap
fun_ptr
(
groups
,
fun_defs
,
imported_types
,
collected_imports
,
type_heaps
,
var_heap
)
#
(
FI_Function
{
gf_fun_def
,
gf_fun_index
})
=
sreadPtr
fun_ptr
ti_fun_heap
// Sjaak
...
...
@@ -2742,8 +2749,8 @@ set_extended_expr_info expr_info_ptr extension expr_info_heap
->
expr_info_heap
<:=
(
expr_info_ptr
,
EI_Extended
extension
ei
)
ei
->
expr_info_heap
<:=
(
expr_info_ptr
,
EI_Extended
extension
ei
)
convertSymbolType
::
!
Bool
!{#
CommonDefs
}
!
SymbolType
!
Int
!*
{#{#
Check
edType
Def
}}
!
ImportedConstructors
!*
TypeHeaps
!*
VarHeap
->
(!
SymbolType
,
!*
{#{#
Check
edType
Def
}}
,
!
ImportedConstructors
,
!*
TypeHeaps
,
!*
VarHeap
)
convertSymbolType
::
!
Bool
!{#
CommonDefs
}
!
SymbolType
!
Int
!*
Import
edType
s
!
ImportedConstructors
!*
TypeHeaps
!*
VarHeap
->
(!
SymbolType
,
!*
Import
edType
s
,
!
ImportedConstructors
,
!*
TypeHeaps
,
!*
VarHeap
)
convertSymbolType
rem_annots
common_defs
st
main_dcl_module_n
imported_types
collected_imports
type_heaps
var_heap
#
(
st
,
{
ets_type_defs
,
ets_collected_conses
,
ets_type_heaps
,
ets_var_heap
})
=
expandSynTypesInSymbolType
rem_annots
common_defs
st
{
ets_type_defs
=
imported_types
,
ets_collected_conses
=
collected_imports
,
ets_type_heaps
=
type_heaps
,
ets_var_heap
=
var_heap
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment