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
6ff38bf1
Commit
6ff38bf1
authored
Jun 29, 2018
by
John van Groningen
Browse files
add EOL property
parent
8fcf5c33
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
frontend/expand_types.dcl
View file @
6ff38bf1
definition
module
expand_types
import
syntax
simplifyTypeApplication
::
!
Type
![
AType
]
->
Type
convertSymbolType
::
!
Bool
!{#
CommonDefs
}
!
SymbolType
!
Int
!*
ImportedTypes
!
ImportedConstructors
!*
TypeHeaps
!*
VarHeap
->
(!
SymbolType
,
!*
ImportedTypes
,!
ImportedConstructors
,!*
TypeHeaps
,!*
VarHeap
)
convertSymbolTypeWithoutExpandingAbstractSynTypes
::
!
Bool
!{#
CommonDefs
}
!
SymbolType
!
Int
!*
ImportedTypes
!
ImportedConstructors
!*
TypeHeaps
!*
VarHeap
->
(!
SymbolType
,
!
Bool
,
!*
ImportedTypes
,!
ImportedConstructors
,!*
TypeHeaps
,!*
VarHeap
)
convertSymbolTypeWithoutCollectingImportedConstructors
::
!
Bool
!{#
CommonDefs
}
!
SymbolType
!
Int
!*
ImportedTypes
!*
TypeHeaps
!*
VarHeap
->
(!
SymbolType
,!*
ImportedTypes
,!*
TypeHeaps
,!*
VarHeap
)
addTypesOfDictionaries
::
!{#
CommonDefs
}
![
TypeContext
]
![
AType
]
->
[
AType
]
RemoveAnnotationsMask
:==
1
ExpandAbstractSynTypesMask
:==
2
DontCollectImportedConstructors
:==
4
::
ExpandTypeState
=
{
ets_type_defs
::
!.{#{#
CheckedTypeDef
}}
,
ets_collected_conses
::
!
ImportedConstructors
,
ets_type_heaps
::
!.
TypeHeaps
,
ets_var_heap
::
!.
VarHeap
,
ets_main_dcl_module_n
::
!
Int
,
ets_contains_unexpanded_abs_syn_type
::
!
Bool
}
class
expandSynTypes
a
::
!
Int
!{#
CommonDefs
}
!
a
!*
ExpandTypeState
->
(!
Bool
,!
a
,
!*
ExpandTypeState
)
instance
expandSynTypes
(
a
,
b
)
|
expandSynTypes
a
&
expandSynTypes
b
special
a
=[
AType
],
b
=
AType
class
substitute
a
::
!
a
!*
TypeHeaps
->
(!
Bool
,
!
a
,
!*
TypeHeaps
)
instance
substitute
Type
,
AType
,
TypeContext
,
AttrInequality
,
CaseType
instance
substitute
[
a
]
|
substitute
a
special
a
=
AType
;
a
=
TypeContext
;
a
=
AttrInequality
class
removeAnnotations
a
::
!
a
->
(!
Bool
,
!
a
)
instance
removeAnnotations
Type
,
SymbolType
definition
module
expand_types
import
syntax
simplifyTypeApplication
::
!
Type
![
AType
]
->
Type
convertSymbolType
::
!
Bool
!{#
CommonDefs
}
!
SymbolType
!
Int
!*
ImportedTypes
!
ImportedConstructors
!*
TypeHeaps
!*
VarHeap
->
(!
SymbolType
,
!*
ImportedTypes
,!
ImportedConstructors
,!*
TypeHeaps
,!*
VarHeap
)
convertSymbolTypeWithoutExpandingAbstractSynTypes
::
!
Bool
!{#
CommonDefs
}
!
SymbolType
!
Int
!*
ImportedTypes
!
ImportedConstructors
!*
TypeHeaps
!*
VarHeap
->
(!
SymbolType
,
!
Bool
,
!*
ImportedTypes
,!
ImportedConstructors
,!*
TypeHeaps
,!*
VarHeap
)
convertSymbolTypeWithoutCollectingImportedConstructors
::
!
Bool
!{#
CommonDefs
}
!
SymbolType
!
Int
!*
ImportedTypes
!*
TypeHeaps
!*
VarHeap
->
(!
SymbolType
,!*
ImportedTypes
,!*
TypeHeaps
,!*
VarHeap
)
addTypesOfDictionaries
::
!{#
CommonDefs
}
![
TypeContext
]
![
AType
]
->
[
AType
]
RemoveAnnotationsMask
:==
1
ExpandAbstractSynTypesMask
:==
2
DontCollectImportedConstructors
:==
4
::
ExpandTypeState
=
{
ets_type_defs
::
!.{#{#
CheckedTypeDef
}}
,
ets_collected_conses
::
!
ImportedConstructors
,
ets_type_heaps
::
!.
TypeHeaps
,
ets_var_heap
::
!.
VarHeap
,
ets_main_dcl_module_n
::
!
Int
,
ets_contains_unexpanded_abs_syn_type
::
!
Bool
}
class
expandSynTypes
a
::
!
Int
!{#
CommonDefs
}
!
a
!*
ExpandTypeState
->
(!
Bool
,!
a
,
!*
ExpandTypeState
)
instance
expandSynTypes
(
a
,
b
)
|
expandSynTypes
a
&
expandSynTypes
b
special
a
=[
AType
],
b
=
AType
class
substitute
a
::
!
a
!*
TypeHeaps
->
(!
Bool
,
!
a
,
!*
TypeHeaps
)
instance
substitute
Type
,
AType
,
TypeContext
,
AttrInequality
,
CaseType
instance
substitute
[
a
]
|
substitute
a
special
a
=
AType
;
a
=
TypeContext
;
a
=
AttrInequality
class
removeAnnotations
a
::
!
a
->
(!
Bool
,
!
a
)
instance
removeAnnotations
Type
,
SymbolType
frontend/expand_types.icl
View file @
6ff38bf1
This diff is collapsed.
Click to expand it.
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