Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
compiler
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
16
Issues
16
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
clean-compiler-and-rts
compiler
Commits
41d0d5d8
Commit
41d0d5d8
authored
Jun 06, 2018
by
John van Groningen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make gtd_num_conses 0 for newtypes
parent
2989b654
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
frontend/generics1.icl
frontend/generics1.icl
+2
-2
No files found.
frontend/generics1.icl
View file @
41d0d5d8
...
...
@@ -708,7 +708,7 @@ buildTypeDefInfo td=:{td_rhs = AbstractType _, td_ident, td_pos} td_module main_
#
error
=
reportError
td_ident
.
id_name
td_pos
"cannot build constructor information for an abstract type"
error
=
buildAlgebraicTypeDefInfo
td
[]
td_module
main_module_index
predefs
funs_and_groups
modules
heaps
error
buildAlgebraicTypeDefInfo
{
td_ident
,
td_pos
,
td_arity
}
alts
td_module
main_module_index
predefs
buildAlgebraicTypeDefInfo
{
td_ident
,
td_pos
,
td_arity
,
td_rhs
}
alts
td_module
main_module_index
predefs
funs_and_groups
=:{
fg_fun_index
=
fun_index
,
fg_group_index
=
group_index
,
fg_funs
=
funs
,
fg_groups
=
groups
}
modules
heaps
error
#
num_conses
=
length
alts
...
...
@@ -756,7 +756,7 @@ where
build_type_def_dsc
group_index
/*cons_info_dss*/
{
ds_ident
}
cons_desc_list_ds
heaps
#
td_name_expr
=
makeStringExpr
td_ident
.
id_name
// gtd_name
#
td_arity_expr
=
makeIntExpr
td_arity
// gtd_arity
#
num_conses_expr
=
makeIntExpr
(
length
alts
)
// gtd_num_conses
#
num_conses_expr
=
makeIntExpr
(
case
td_rhs
of
AlgType
alts
->
length
alts
;
_
->
0
)
// gtd_num_conses
#
(
gtd_conses_expr
,
heaps
)
=
buildFunApp
main_module_index
cons_desc_list_ds
[]
heaps
// gtd_conses
#
(
body_expr
,
heaps
)
=
buildPredefConsApp
PD_CGenericTypeDefDescriptor
[
td_name_expr
,
td_arity_expr
,
num_conses_expr
,
gtd_conses_expr
]
// TODO: module_name_expr
...
...
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