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
6ee6828e
Commit
6ee6828e
authored
Mar 20, 2021
by
Sapphie
Browse files
Implement sub primitive
parent
284fa4ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
compiler/src/l3/CPSValueRepresenter.scala
View file @
6ee6828e
...
...
@@ -12,6 +12,10 @@ object CPSValueRepresenter extends (H.Tree => L.Tree) {
tempLetP
(
CPS
.
Sub
,
Seq
(
Left
(
x
),
Right
(
1
)))
{
x1
=>
L
.
LetP
(
n
,
CPS
.
Add
,
Seq
(
x1
,
rewrite
(
y
)),
apply
(
body
))
}
case
H
.
LetP
(
n
,
L3
.
IntSub
,
Seq
(
x
,
y
),
body
)
=>
tempLetP
(
CPS
.
Add
,
Seq
(
Left
(
x
),
Right
(
1
)))
{
x1
=>
L
.
LetP
(
n
,
CPS
.
Sub
,
Seq
(
x1
,
rewrite
(
y
)),
apply
(
body
))
}
}
...
...
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