Skip to content
GitLab
Menu
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
6ea2b124
Commit
6ea2b124
authored
Jan 24, 2003
by
John van Groningen
Browse files
added convertSymbolTypeWithoutCollectingImportedConstructors
to fix a bug if type synonyms are used and a .tcl file is generated
parent
a76e27e0
Changes
3
Hide whitespace changes
Inline
Side-by-side
frontend/trans.dcl
View file @
6ea2b124
...
...
@@ -12,4 +12,7 @@ transformGroups :: !CleanupInfo !Int !Int !Int !Int !*{!Group} !*{#FunDef} !*{!.
convertSymbolType
::
!
Bool
!{#
CommonDefs
}
!
SymbolType
!
Int
!*
ImportedTypes
!
ImportedConstructors
!*
TypeHeaps
!*
VarHeap
->
(!
SymbolType
,
!*
ImportedTypes
,
!
ImportedConstructors
,
!*
TypeHeaps
,
!*
VarHeap
)
convertSymbolTypeWithoutCollectingImportedConstructors
::
!
Bool
!{#
CommonDefs
}
!
SymbolType
!
Int
!*
ImportedTypes
!*
TypeHeaps
!*
VarHeap
->
(!
SymbolType
,
!*
ImportedTypes
,
!*
TypeHeaps
,
!*
VarHeap
)
addTypesOfDictionaries
::
!{#
CommonDefs
}
![
TypeContext
]
![
AType
]
->
[
AType
]
frontend/trans.icl
View file @
6ea2b124
...
...
@@ -3485,6 +3485,7 @@ where
RemoveAnnotationsMask
:==
1
ExpandAbstractSynTypesMask
:==
2
DontCollectImportedConstructors
:==
4
convertSymbolType
::
!
Bool
!{#
CommonDefs
}
!
SymbolType
!
Int
!*
ImportedTypes
!
ImportedConstructors
!*
TypeHeaps
!*
VarHeap
->
(!
SymbolType
,
!*
ImportedTypes
,
!
ImportedConstructors
,
!*
TypeHeaps
,
!*
VarHeap
)
...
...
@@ -3493,6 +3494,13 @@ convertSymbolType rem_annots common_defs st main_dcl_module_n imported_types col
=
convertSymbolType_
(
if
rem_annots
(
RemoveAnnotationsMask
bitor
ExpandAbstractSynTypesMask
)
ExpandAbstractSynTypesMask
)
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
)
convertSymbolTypeWithoutCollectingImportedConstructors
::
!
Bool
!{#
CommonDefs
}
!
SymbolType
!
Int
!*
ImportedTypes
!*
TypeHeaps
!*
VarHeap
->
(!
SymbolType
,
!*
ImportedTypes
,
!*
TypeHeaps
,
!*
VarHeap
)
convertSymbolTypeWithoutCollectingImportedConstructors
rem_annots
common_defs
st
main_dcl_module_n
imported_types
type_heaps
var_heap
#
(
st
,
ets_contains_unexpanded_abs_syn_type
,
ets_type_defs
,
ets_collected_conses
,
ets_type_heaps
,
ets_var_heap
)
=
convertSymbolType_
(
if
rem_annots
(
RemoveAnnotationsMask
bitor
ExpandAbstractSynTypesMask
bitor
DontCollectImportedConstructors
)
(
ExpandAbstractSynTypesMask
bitor
DontCollectImportedConstructors
))
common_defs
st
main_dcl_module_n
imported_types
[]
type_heaps
var_heap
=
(
st
,
ets_type_defs
,
ets_type_heaps
,
ets_var_heap
)
convertSymbolType_
::
!
Int
!{#
CommonDefs
}
!
SymbolType
!
Int
!*
ImportedTypes
!
ImportedConstructors
!*
TypeHeaps
!*
VarHeap
->
(!
SymbolType
,
!
Bool
,!*
ImportedTypes
,
!
ImportedConstructors
,
!*
TypeHeaps
,
!*
VarHeap
)
convertSymbolType_
rem_annots
common_defs
st
main_dcl_module_n
imported_types
collected_imports
type_heaps
var_heap
...
...
@@ -3674,7 +3682,7 @@ expand_syn_types_in_TA rem_annots common_defs ta_type attribute ets=:{ets_type_d
TA
type_symb
_
->
TA
type_symb
types
TAS
type_symb
_
strictness
->
TAS
type_symb
types
strictness
)
ta_type
|
glob_module
==
ets
.
ets_main_dcl_module_n
|
glob_module
==
ets
.
ets_main_dcl_module_n
||
(
rem_annots
bitand
DontCollectImportedConstructors
)<>
0
->
(
changed
,
ta_type
,
ets
)
->
(
changed
,
ta_type
,
collect_imported_constructors
common_defs
glob_module
td_rhs
ets
)
where
...
...
frontend/type_io.icl
View file @
6ea2b124
...
...
@@ -225,7 +225,6 @@ where
write_type_info
symbol_type
tcl_file
wtis
#!
({
st_vars
,
st_args
,
st_args_strictness
,
st_arity
,
st_result
},
wtis
)
=
expand_symbol_type
symbol_type
wtis
#
(
tcl_file
,
wtis
)
=
write_type_info
st_vars
tcl_file
wtis
#
(
tcl_file
,
wtis
)
...
...
@@ -239,8 +238,8 @@ where
=
(
tcl_file
,
wtis
)
where
expand_symbol_type
symbol_type
wtis
=:{
wtis_common_defs
,
wtis_type_defs
,
wtis_main_dcl_module_n
,
wtis_collected_conses
,
wtis_type_heaps
,
wtis_var_heap
}
#
(
expanded_symbol_type
,
wtis_type_defs
,
wtis_
collected_conses
,
wtis_
type_heaps
,
wtis_var_heap
)
=
convertSymbolType
False
wtis_common_defs
symbol_type
wtis_main_dcl_module_n
wtis_type_defs
[]
/* ? */
wtis_type_heaps
wtis_var_heap
;
#
(
expanded_symbol_type
,
wtis_type_defs
,
wtis_type_heaps
,
wtis_var_heap
)
=
convertSymbolType
WithoutCollectingImportedConstructors
False
wtis_common_defs
symbol_type
wtis_main_dcl_module_n
wtis_type_defs
wtis_type_heaps
wtis_var_heap
;
#
wtis
=
{
wtis
&
wtis_type_defs
=
wtis_type_defs
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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