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
9480b940
Commit
9480b940
authored
Nov 10, 2017
by
John van Groningen
Browse files
add type of function determine_attribute_of_cons,
use synonym type AttrVarHeap instead of Heap AttrVarInfo
parent
c67c0807
Changes
1
Hide whitespace changes
Inline
Side-by-side
frontend/type.icl
View file @
9480b940
...
...
@@ -778,12 +778,12 @@ fresh_type_variables type_variables state
=
foldSt
(\{
atv_variable
={
tv_info_ptr
}}
(
var_heap
,
var_store
)
->
(
var_heap
<:=
(
tv_info_ptr
,
TVI_Type
(
TempV
var_store
)),
inc
var_store
))
type_variables
state
fresh_attributes
::
[
AttributeVar
]
*(*
Heap
AttrVar
Info
,
Int
)
->
*(!*
Heap
AttrVar
Info
,!
Int
);
fresh_attributes
::
[
AttributeVar
]
*(*
AttrVar
Heap
,
Int
)
->
*(!*
AttrVar
Heap
,!
Int
);
fresh_attributes
attributes
state
=
foldSt
(\{
av_info_ptr
}
(
attr_heap
,
attr_store
)
->
(
attr_heap
<:=
(
av_info_ptr
,
AVI_Attr
(
TA_TempVar
attr_store
)),
inc
attr_store
))
attributes
state
fresh_environment
::
[
AttrInequality
]
[
AttrCoercion
]
*
(
Heap
AttrVar
Info
)
->
*(![
AttrCoercion
],!*
Heap
AttrVar
Info
);
fresh_environment
::
[
AttrInequality
]
[
AttrCoercion
]
*
AttrVar
Heap
->
*(![
AttrCoercion
],!*
AttrVar
Heap
);
fresh_environment
inequalities
attr_env
attr_heap
=
foldSt
fresh_inequality
inequalities
(
attr_env
,
attr_heap
)
where
...
...
@@ -1101,7 +1101,7 @@ addToExistentialVariables pos [] exis_variables
addToExistentialVariables
pos
new_exis_variables
exis_variables
=
[(
pos
,
new_exis_variables
)
:
exis_variables
]
freshInequality
::
AttrInequality
*
(
Heap
AttrVar
Info
)
->
(!
AttrCoercion
,!
.
Heap
AttrVar
Info
);
freshInequality
::
AttrInequality
*
AttrVar
Heap
->
(!
AttrCoercion
,!
*
AttrVar
Heap
);
freshInequality
{
ai_demanded
,
ai_offered
}
attr_heap
#
(
av_dem_info
,
attr_heap
)
=
readPtr
ai_demanded
.
av_info_ptr
attr_heap
(
av_off_info
,
attr_heap
)
=
readPtr
ai_offered
.
av_info_ptr
attr_heap
...
...
@@ -1173,6 +1173,8 @@ attribute_error type_attr (Yes err)
#
err
=
errorHeading
"Type error"
err
=
Yes
{
err
&
ea_file
=
err
.
ea_file
<<<
"* attribute expected instead of "
<<<
type_attr
<<<
'\n'
}
determine_attribute_of_cons
::
!
TypeAttribute
![
AType
]
Int
!*
AttrVarHeap
![
AttributeVar
]
![
AttrInequality
]
!*(
Optional
*
ErrorAdmin
)
->
(!
TypeAttribute
,
Int
,!*
AttrVarHeap
,![
AttributeVar
],![
AttrInequality
],!*
Optional
*
ErrorAdmin
)
determine_attribute_of_cons
TA_Unique
cons_args
prop_class
attr_var_heap
attr_vars
attr_env
ps_error
=
(
TA_Unique
,
prop_class
>>
length
cons_args
,
attr_var_heap
,
attr_vars
,
attr_env
,
ps_error
)
determine_attribute_of_cons
cons_attr
cons_args
prop_class
attr_var_heap
attr_vars
attr_env
ps_error
...
...
@@ -1183,7 +1185,7 @@ determine_attribute_of_cons cons_attr cons_args prop_class attr_var_heap attr_va
where
determine_cummulative_attribute
[]
cumm_attr
attr_vars
prop_class
=
(
cumm_attr
,
attr_vars
,
prop_class
)
determine_cummulative_attribute
[
t
=:
{
at_attribute
}
:
types
]
cumm_attr
attr_vars
prop_class
determine_cummulative_attribute
[{
at_attribute
}
:
types
]
cumm_attr
attr_vars
prop_class
|
prop_class
bitand
1
==
0
=
determine_cummulative_attribute
types
cumm_attr
attr_vars
(
prop_class
>>
1
)
=
case
at_attribute
of
...
...
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