-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
translation to primative operations (#329)
* helper functions for binary and unary expressions; first crack at translating add, which led to #322 * helper functions for binary and unary translations and the obvious translations with a couple of todos. stub of test case. * scala style * small changes to assignment * adding other operations even though this does not work yet * Adding back in a default case and some comments in the test file * adding a todo noting repeated work so i dont forget. its a small optimization but an easy one * further thoughts in a todo * fixing a bug in less or equal and great or equal. its not the best fix but it will work for now * removing some code that didn\'t pan out * whitespace and scala style * removing the json file for prim ops; that file parses but causes travis to fail because of #327 and #328 but i want to get this code merged before fixng those issues * fixing primative operations syntax
- Loading branch information
Showing
3 changed files
with
81 additions
and
53 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
main contract PrimOps{ | ||
int x; | ||
bool y; | ||
|
||
transaction primops() { | ||
y = true && false; | ||
y = true || false; | ||
|
||
x = 4 + 4; | ||
x = 4 - 4; | ||
x = 4 / 4; | ||
x = 4 * 4; | ||
x = 4 % 4; | ||
|
||
y = 1 == 2; | ||
y = 1 != 2; | ||
y = 3 > 4; | ||
y = 3 >= 4; | ||
y = 3 < 3; | ||
y = 3 <= 3; | ||
y = 3 != 3; | ||
|
||
y = !y; | ||
x = - x; | ||
|
||
return; | ||
} | ||
} |
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