-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Fixed print bug, tests incomplete, read more
I was sidetracked by a strange display bug - turns out it was caused by pointers - this commit fixes it. The tests for if-then-else still aren't finished, but I'm knocking off as it's past my time limit. I've marked 'TODO' and 'URGENT' using comments, so finding the issues should be easy.
- Loading branch information
1 parent
b29a878
commit 7d4ea48
Showing
3 changed files
with
20 additions
and
20 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
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,66 +1,66 @@ | ||
|
||
//literals | ||
if (true) { | ||
print "Success"; | ||
print "Success 1"; | ||
} | ||
else { | ||
print "Failure"; | ||
print "Failure 1"; | ||
} | ||
|
||
//false literals | ||
if (false) { | ||
print "Failure"; | ||
print "Failure 2"; | ||
} | ||
else { | ||
print "Success"; | ||
print "Success 2"; | ||
} | ||
|
||
//conditionals | ||
if (1 < 2) { | ||
print "Success"; | ||
print "Success 3"; | ||
} | ||
if (1 > 2) { | ||
print "Failure"; | ||
print "Failure 3"; | ||
} | ||
|
||
|
||
//variables | ||
var a = 42; | ||
|
||
if (a) { | ||
print "Success"; | ||
print "Success 4"; | ||
} | ||
else { | ||
print "Failure"; | ||
print "Failure 4"; | ||
} | ||
|
||
|
||
if (a == 42) { | ||
print "Success"; | ||
print "Success 5"; | ||
} | ||
else { | ||
print "Failure"; | ||
print "Failure 5"; | ||
} | ||
|
||
//concatenated strings | ||
if ("foo" .. "bar" == "foobar") { | ||
print "Success"; | ||
print "Success 6"; | ||
} | ||
else { | ||
print "Failure"; | ||
print "Failure 6"; | ||
} | ||
|
||
|
||
if ("foobar" == "foo" .. "bar") { | ||
print "Success"; | ||
print "Success 7"; | ||
} | ||
else { | ||
print "Failure"; | ||
print "Failure 7"; | ||
} | ||
|
||
if ("fizz" .. "le" == "fi" .. "zzle") { | ||
print "Success"; | ||
print "Success 8"; | ||
} | ||
else { | ||
print "Failure"; | ||
} | ||
print "Failure 8"; | ||
} |