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
f606f73f
Commit
f606f73f
authored
Mar 08, 2007
by
John van Groningen
Browse files
pass two lists to functions init_type_vars and init_attr_vars,
instead of using ++ to concatenate the lists for each call
parent
879f34e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
frontend/comparedefimp.icl
View file @
f606f73f
...
...
@@ -539,18 +539,15 @@ symbolTypesCorrespond symbol_type_1 symbol_type_2 type_heaps=:{th_vars, th_attrs
=
{
th_vars
=
tc_type_vars
.
hwn_heap
,
th_attrs
=
tc_attr_vars
.
hwn_heap
}
init_symbol_type_vars
symbol_type_1
symbol_type_2
tc_state
#
tc_state
=
init_attr_vars
(
symbol_type_1
.
st_attr_vars
++
symbol_type_2
.
st_attr_vars
)
tc_state
tc_state
=
init_type_vars
(
symbol_type_1
.
st_vars
++
symbol_type_2
.
st_vars
)
tc_state
#
tc_state
=
init_attr_vars
symbol_type_1
.
st_attr_vars
symbol_type_2
.
st_attr_vars
tc_state
tc_state
=
init_type_vars
symbol_type_1
.
st_vars
symbol_type_2
.
st_vars
tc_state
=
tc_state
init_type_vars
type_vars
tc_state
=:{
tc_type_vars
}
#
tc_type_vars
=
init_type_vars`
type_vars
tc_type_vars
=
{
tc_state
&
tc_type_vars
=
tc_type_vars
}
init_type_vars
type_vars1
type_vars2
tc_state
=:{
tc_type_vars
=
tc_type_vars
=:{
hwn_heap
}}
#
hwn_heap
=
foldSt
init_type_var
type_vars1
hwn_heap
#
hwn_heap
=
foldSt
init_type_var
type_vars2
hwn_heap
=
{
tc_state
&
tc_type_vars
=
{
tc_type_vars
&
hwn_heap
=
hwn_heap
}}
where
init_type_vars`
type_vars
tc_type_vars
=:{
hwn_heap
}
#
hwn_heap
=
foldSt
init_type_var
type_vars
hwn_heap
=
{
tc_type_vars
&
hwn_heap
=
hwn_heap
}
init_type_var
{
tv_info_ptr
}
heap
=
writePtr
tv_info_ptr
TVI_Empty
heap
...
...
@@ -729,8 +726,7 @@ instance t_corresponds (TypeDef TypeRhs) where
t_corresponds_TypeDef
dclDef
iclDef
tc_state
// | False--->("comparing:", dclDef, iclDef)
// = undef
#
tc_state
=
init_attr_vars
dclDef
.
td_attrs
tc_state
tc_state
=
init_attr_vars
iclDef
.
td_attrs
tc_state
#
tc_state
=
init_attr_vars
dclDef
.
td_attrs
iclDef
.
td_attrs
tc_state
tc_state
=
init_atype_vars
dclDef
.
td_args
tc_state
tc_state
=
init_atype_vars
iclDef
.
td_args
tc_state
=
t_corresponds
(
dclDef
.
td_args
,
(
dclDef
.
td_rhs
,
(
dclDef
.
td_context
,
dclDef
.
td_attribute
)))
...
...
@@ -780,8 +776,11 @@ instance t_corresponds AType where
instance
t_corresponds
TypeAttribute
where
t_corresponds
TA_Unique
TA_Unique
=
return
True
t_corresponds
TA_Multi
TA_Multi
=
return
True
t_corresponds
TA_Multi
icl
=
case
icl
of
TA_Multi
->
return
True
TA_None
->
return
True
_
->
return
False
t_corresponds
(
TA_Var
dclDef
)
(
TA_Var
iclDef
)
=
t_corresponds
dclDef
iclDef
t_corresponds
(
TA_RootVar
dclDef
)
(
TA_RootVar
iclDef
)
...
...
@@ -791,11 +790,6 @@ instance t_corresponds TypeAttribute where
TA_Multi
->
return
True
TA_None
->
return
True
_
->
return
False
t_corresponds
TA_Multi
icl
=
case
icl
of
TA_Multi
->
return
True
TA_None
->
return
True
_
->
return
False
t_corresponds
_
_
=
return
False
...
...
@@ -927,7 +921,7 @@ instance t_corresponds AttrInequality where
instance
t_corresponds
ClassDef
where
t_corresponds
dclDef
iclDef
=
do
(
init_type_vars
(
dclDef
.
class_args
++
iclDef
.
class_args
)
)
=
do
(
init_type_vars
dclDef
.
class_args
iclDef
.
class_args
)
&&&
equal
dclDef
.
class_ident
iclDef
.
class_ident
&&&
t_corresponds
dclDef
.
class_args
iclDef
.
class_args
&&&
t_corresponds
dclDef
.
class_context
iclDef
.
class_context
...
...
@@ -935,8 +929,8 @@ instance t_corresponds ClassDef where
instance
t_corresponds
MemberDef
where
t_corresponds
dclDef
iclDef
=
do
(
init_type_vars
(
dclDef
.
me_type
.
st_vars
++
iclDef
.
me_type
.
st_vars
)
)
&&&
do
(
init_attr_vars
(
dclDef
.
me_type
.
st_attr_vars
++
iclDef
.
me_type
.
st_attr_vars
)
)
=
do
(
init_type_vars
dclDef
.
me_type
.
st_vars
iclDef
.
me_type
.
st_vars
)
&&&
do
(
init_attr_vars
dclDef
.
me_type
.
st_attr_vars
iclDef
.
me_type
.
st_attr_vars
)
&&&
equal
dclDef
.
me_ident
iclDef
.
me_ident
&&&
equal
dclDef
.
me_offset
iclDef
.
me_offset
&&&
equal
dclDef
.
me_priority
iclDef
.
me_priority
...
...
@@ -947,10 +941,8 @@ instance t_corresponds ClassInstance where
=
t_corresponds`
dclDef
.
ins_type
iclDef
.
ins_type
where
t_corresponds`
dclDef
iclDef
tc_state
#
tc_state
=
init_attr_vars
(
dclDef
.
it_attr_vars
++
iclDef
.
it_attr_vars
)
tc_state
tc_state
=
init_type_vars
(
dclDef
.
it_vars
++
iclDef
.
it_vars
)
tc_state
#
tc_state
=
init_attr_vars
dclDef
.
it_attr_vars
iclDef
.
it_attr_vars
tc_state
tc_state
=
init_type_vars
dclDef
.
it_vars
iclDef
.
it_vars
tc_state
(
corresponds
,
tc_state
)
=
t_corresponds
dclDef
.
it_types
iclDef
.
it_types
tc_state
|
not
corresponds
...
...
@@ -1254,10 +1246,10 @@ continuation_for_possibly_twice_defined_macros dcl_app_symb dcl_module_index dcl
name_is_location_dependent
_
=
False
init_attr_vars
attr_vars
tc_state
=:{
tc_attr_vars
}
#
hwn_heap
=
foldSt
init_attr_var
attr_vars
tc_attr_vars
.
hwn_heap
tc_attr_vars
=
{
tc_
attr_vars
&
hwn_heap
=
hwn_heap
}
=
{
tc_state
&
tc_attr_vars
=
tc_attr_vars
}
init_attr_vars
attr_vars
1
attr_vars2
tc_state
=:{
tc_attr_vars
=
tc_attr_vars
=:{
hwn_heap
}
}
#
hwn_heap
=
foldSt
init_attr_var
attr_vars
1
hwn_heap
#
hwn_heap
=
foldSt
init_attr_var
attr_vars
2
hwn_heap
=
{
tc_state
&
tc_attr_vars
=
{
tc_attr_vars
&
hwn_heap
=
hwn_heap
}
}
where
init_attr_var
{
av_info_ptr
}
attr_heap
=
writePtr
av_info_ptr
AVI_Empty
attr_heap
...
...
Write
Preview
Markdown
is supported
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