Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Haley Sapphie Owsianko
ACC-project
Commits
a5800231
Commit
a5800231
authored
Apr 14, 2021
by
Luca Bataillard
Browse files
fix hoisting by adding new funs to hoisted set
parent
f59f255c
Changes
1
Hide whitespace changes
Inline
Side-by-side
compiler/src/l3/CPSHoister.scala
View file @
a5800231
...
...
@@ -15,8 +15,7 @@ object CPSHoister extends (Tree => LetF) {
.
unzip
val
LetF
(
funsHoistedBody
,
hoistedBody
)
=
apply
(
body
)
val
funsHoistedFlat
=
(
funsHoistedCnts
:+
funsHoistedBody
).
flatten
val
funsHoistedFlat
=
funsHoistedCnts
.
flatten
++
funsHoistedBody
LetF
(
funsHoistedFlat
,
LetC
(
newCnts
,
hoistedBody
))
case
LetF
(
funs
,
body
)
=>
...
...
@@ -27,7 +26,7 @@ object CPSHoister extends (Tree => LetF) {
}.
unzip
val
LetF
(
funsHoistedBody
,
hoistedBody
)
=
apply
(
body
)
val
funsHoistedFlat
=
(
funsHoistedFuns
:
+
funsHoistedBody
).
flatten
val
funsHoistedFlat
=
newFuns
++
funsHoistedFuns
.
flatten
+
+
funsHoistedBody
LetF
(
funsHoistedFlat
,
hoistedBody
)
case
e
=>
LetF
(
Seq
(),
e
)
...
...
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