-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(closes #44 - feature/translate-if/44)
Squashed commit of the following: commit aa5362b Author: Brandon Li <[email protected]> Date: Tue Mar 14 21:59:54 2023 -0700 fmt commit 70948f2 Author: Brandon Li <[email protected]> Date: Tue Mar 14 21:59:40 2023 -0700 lint fmt commit 9ce6908 Author: Brandon Li <[email protected]> Date: Mon Mar 13 15:03:20 2023 -0700 cleanup tests for compilation error commit 6ad5480 Author: Brandon Li <[email protected]> Date: Fri Mar 10 15:42:01 2023 -0800 shadow as declared commit ec99266 Author: Brandon Li <[email protected]> Date: Fri Mar 10 14:18:46 2023 -0800 type reference parsed commit 9f99768 Author: Brandon Li <[email protected]> Date: Wed Mar 8 19:42:29 2023 -0800 reg alloc if commit a541dec Author: Brandon Li <[email protected]> Date: Tue Mar 7 21:28:52 2023 -0800 translate if
- Loading branch information
1 parent
d1f34d6
commit 23cbfae
Showing
42 changed files
with
1,696 additions
and
356 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,54 @@ | ||
if a < b { | ||
1 + 2; | ||
2 + 3 | ||
let a: int = let b: int = a | ||
|
||
## | ||
let a: int = 0 | ||
let b: int = 0 | ||
let c: int = 0 | ||
|
||
let d: int = if (if true { c <= 0 } else { 1 + 2 + 3 < 6 }) { | ||
a + b | ||
} | ||
else if c { | ||
2 + 3 | ||
else if (if false { false } else { true }) { | ||
2 | ||
} | ||
else if d { | ||
1 + 2 | ||
else { | ||
let d: int = b + c + 2 | ||
} | ||
|
||
|
||
|
||
let a = 0 | ||
let b = 0 | ||
let c = 0 | ||
|
||
let temp2 = if true { {a, b, c} | ||
c <= 0 {temp2, a, b, c} | ||
} | ||
else { | ||
let temp0 = 1 + 2 {temp2, a, b, c} | ||
let temp1 = temp0 + temp3 {temp0, temp2, a, b, c} | ||
temp1 < 6 {temp1, temp2, a, b, c} | ||
} | ||
else if c { | ||
a | ||
|
||
let d = if temp2 { {temp2, a, b, c} | ||
a + b {d, a, b} | ||
} | ||
else { | ||
2 + 1 | ||
let temp3 = if false { {d, b, c} | ||
false | ||
} | ||
else { | ||
true | ||
} | ||
|
||
if temp3 { {d, b, c, temp3} | ||
2 {d} | ||
} else { | ||
let temp4 = b + c {d, b, c} | ||
let e = temp4 + 2 {d, temp4} | ||
e {e, d} | ||
} | ||
} | ||
|
||
d {d} | ||
## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.