-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Showing
2 changed files
with
73 additions
and
0 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,39 @@ | ||
# initialize | ||
on: initialize | ||
console.log("-----------------------") | ||
console.log("loop-test: Initialize") | ||
console.log("-----------------------") | ||
console.log() | ||
end | ||
|
||
# if no condition is met, nothing will be executed, lol :D | ||
on: nothing | ||
console.log("--------------------") | ||
console.log("loop-test: Nothing") | ||
console.log("--------------------") | ||
console.log() | ||
$array = [1,2,3,4,5,6] | ||
$i = 0 | ||
# tests for continue, break | ||
# if successfull we should see 1, 2, 4 | ||
forCondition($i < $array->length()) | ||
$i++ | ||
if ($i == 3) | ||
continue | ||
end | ||
if ($i == 5) | ||
break | ||
end | ||
console.log($i) | ||
end | ||
script.stop() | ||
end | ||
|
||
# an error has occurred | ||
on: error | ||
console.log("------------------") | ||
console.log("loop-test: Error") | ||
console.log("------------------") | ||
console.log("An error occurred") | ||
script.stop() | ||
end |
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,34 @@ | ||
# initialize | ||
on: initialize | ||
console.log("-------------------------------") | ||
console.log("preprocessor-test: Initialize") | ||
console.log("------------------------------") | ||
console.log() | ||
end | ||
|
||
# if no condition is met, nothing will be executed, lol :D | ||
on: nothing | ||
console.log("----------------------------") | ||
console.log("preprocessor-test: Nothing") | ||
console.log("----------------------------") | ||
console.log() | ||
$i = 0 | ||
# postfix, prefix operator | ||
console.log("$i: " + $i) | ||
console.log("++$i: " + (++$i)) | ||
console.log("$i++: " + ($i++)) | ||
console.log("$i: " + $i) | ||
# 2 argument operator with left and right arguments | ||
console.log("10 * 10: " + 10 * 10) | ||
# | ||
script.stop() | ||
end | ||
|
||
# an error has occurred | ||
on: error | ||
console.log("--------------------------") | ||
console.log("preprocessor-test: Error") | ||
console.log("--------------------------") | ||
console.log() | ||
script.stop() | ||
end |