-
-
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.
- Loading branch information
1 parent
34577ec
commit b2b2ca7
Showing
3 changed files
with
58 additions
and
5 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 |
---|---|---|
@@ -1,10 +1,44 @@ | ||
|
||
|
||
//literals | ||
if (true) { | ||
print "Success"; | ||
} | ||
|
||
else { | ||
print "Failed"; | ||
} | ||
|
||
//false literals | ||
if (false) { | ||
print "Failed"; | ||
} | ||
else { | ||
print "Success"; | ||
} | ||
|
||
//conditionals | ||
if (1 < 2) { | ||
print "Success"; | ||
} | ||
if (1 > 2) { | ||
print "Failure"; | ||
} | ||
|
||
|
||
//variables | ||
var a = 42; | ||
|
||
if (a) { | ||
print "Success"; | ||
} | ||
else { | ||
print "Failure"; | ||
} | ||
|
||
|
||
if (a == 42) { | ||
print "Success"; | ||
} | ||
else { | ||
print "Failure"; | ||
} | ||
|
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,19 @@ | ||
set breakpoint pending on | ||
|
||
break toy_vm.c:547 | ||
|
||
command 1 | ||
print opcode | ||
continue | ||
end | ||
|
||
break toy_vm.c:373 | ||
|
||
command 2 | ||
printf "JUMP %d %d %d\n", type, cond, param | ||
continue | ||
end | ||
|
||
break toy_vm.c:375 | ||
|
||
|
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