-
-
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.
Example for literal expression, break, and continue statement.
- Loading branch information
Showing
3 changed files
with
27 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,7 @@ | ||
#!/usr/local/bin/uartix | ||
# Literal expression examples. | ||
|
||
render 3.14 + "\r\n"; # Number | ||
render true + "\r\n"; # True | ||
render false + "\r\n"; # False | ||
render nil; # Nil expression |
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,10 @@ | ||
#!/usr/local/bin/uartix | ||
# Break loop if i is 5. | ||
|
||
loop(i = 0; i < 10; i = i + 1) { | ||
if(i == 5) { | ||
break; | ||
}; | ||
|
||
render i + "\r\n"; | ||
}; |
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,10 @@ | ||
#!/usr/local/bin/uartix | ||
# Skip loop iteration if i is even number. | ||
|
||
loop(i = 0; i < 10; i = i + 1) { | ||
if(i % 2 == 0) { | ||
continue; | ||
}; | ||
|
||
render i + "\r\n"; | ||
}; |