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
157b6efe
Commit
157b6efe
authored
Oct 07, 2002
by
Diederik van Arkel
Browse files
include type when adding cases for bool exprs
parent
f8f0c3fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
frontend/transform.icl
View file @
157b6efe
...
@@ -1807,7 +1807,13 @@ where
...
@@ -1807,7 +1807,13 @@ where
where
where
if_expression
::
Expression
Expression
Expression
*
CollectState
->
(!
Expression
,!.
CollectState
);
if_expression
::
Expression
Expression
Expression
*
CollectState
->
(!
Expression
,!.
CollectState
);
if_expression
e1
e2
e3
cos
if_expression
e1
e2
e3
cos
#
(
new_info_ptr
,
symbol_heap
)
=
newPtr
EI_Empty
cos
.
cos_symbol_heap
// # (new_info_ptr,symbol_heap) = newPtr EI_Empty cos.cos_symbol_heap
#
case_type
=
{
ct_pattern_type
=
MakeAttributedType
(
TB
BT_Bool
)
,
ct_result_type
=
MakeAttributedType
(
TB
BT_Bool
)
,
ct_cons_types
=
[[
MakeAttributedType
(
TB
BT_Bool
)]]
}
#
(
new_info_ptr
,
symbol_heap
)
=
newPtr
(
EI_CaseType
case_type
)
cos
.
cos_symbol_heap
#
kase
=
Case
{
case_expr
=
e1
,
case_guards
=
BasicPatterns
BT_Bool
[{
bp_value
=
BVB
True
,
bp_expr
=
e2
,
bp_position
=
NoPos
}],
#
kase
=
Case
{
case_expr
=
e1
,
case_guards
=
BasicPatterns
BT_Bool
[{
bp_value
=
BVB
True
,
bp_expr
=
e2
,
bp_position
=
NoPos
}],
case_default
=
Yes
e3
,
case_ident
=
No
,
case_info_ptr
=
new_info_ptr
,
case_default_pos
=
NoPos
,
case_default
=
Yes
e3
,
case_ident
=
No
,
case_info_ptr
=
new_info_ptr
,
case_default_pos
=
NoPos
,
case_explicit
=
True
}
case_explicit
=
True
}
...
...
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