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
dcea4965
Commit
dcea4965
authored
May 08, 2001
by
Ronny Wichers Schreur
🏘
Browse files
support for cases in backend
parent
fb5e7960
Changes
1
Hide whitespace changes
Inline
Side-by-side
backend/backendpreprocess.icl
View file @
dcea4965
...
...
@@ -72,9 +72,18 @@ instance sequence (Optional a) | sequence a where
instance
sequence
FunctionBody
where
sequence
(
BackendBody
backEndBodies
)
=
sequence
backEndBodies
sequence
(
TransformedBody
transformedBody
)
=
sequence
transformedBody
sequence
body
=
abort
"preprocess (FunctionBody): unknown body"
<<-
body
// case test ...
instance
sequence
TransformedBody
where
sequence
body
=
sequence
body
.
tb_args
o`
sequence
body
.
tb_rhs
// ... case test
instance
sequence
BackendBody
where
sequence
body
=
sequence
body
.
bb_args
...
...
@@ -102,9 +111,32 @@ instance sequence Expression where
o`
sequence
selections
sequence
(
AnyCodeExpr
_
outParams
_)
=
foldState
(\{
bind_dst
}->
sequence
bind_dst
)
outParams
sequence
(
Case
caseExpr
)
=
sequence
caseExpr
sequence
_
=
identity
instance
sequence
Case
where
sequence
{
case_expr
,
case_guards
,
case_default
}
=
sequence
case_expr
o`
sequence
case_guards
o`
sequence
case_default
instance
sequence
CasePatterns
where
sequence
(
AlgebraicPatterns
_
patterns
)
=
sequence
patterns
sequence
(
BasicPatterns
_
patterns
)
=
sequence
patterns
instance
sequence
AlgebraicPattern
where
sequence
{
ap_vars
,
ap_expr
}
=
sequence
ap_vars
o`
sequence
ap_expr
instance
sequence
BasicPattern
where
sequence
{
bp_expr
}
=
sequence
bp_expr
instance
sequence
Selection
where
sequence
(
RecordSelection
_
_)
=
identity
...
...
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