mirror of
https://github.com/Kugelschieber/asl.git
synced 2026-01-18 03:50:25 +00:00
Special cases for waitUntil and exitWith.
This commit is contained in:
59
README.md
59
README.md
@@ -75,6 +75,12 @@ switch x {
|
||||
default:
|
||||
// ...
|
||||
}
|
||||
|
||||
try {
|
||||
// ...
|
||||
} catch {
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Functions
|
||||
@@ -115,6 +121,59 @@ foo(x, y, z)(1, 2, 3);
|
||||
[x, y, z] foo [1, 2, 3];
|
||||
```
|
||||
|
||||
### Special functions
|
||||
|
||||
There are some special functions in SQF, which also require special syntax in ASL. The examples presented here show how they are written in ASL and what the output will look like. Remember that ASL is case sensitive!
|
||||
|
||||
**exitWith**
|
||||
|
||||
```
|
||||
exitwith {
|
||||
// your code
|
||||
}
|
||||
|
||||
// output:
|
||||
if (true) exitWith {
|
||||
// your code
|
||||
};
|
||||
```
|
||||
|
||||
**waitUntil**
|
||||
|
||||
```
|
||||
waituntil(condition);
|
||||
// or
|
||||
waituntil(expression;condition);
|
||||
|
||||
// output:
|
||||
waitUntil {condition};
|
||||
// or
|
||||
waitUntil {expression;condition};
|
||||
```
|
||||
|
||||
## List of all keywords
|
||||
|
||||
Keywords should not be used as identifiers. Here is a full list of all keywords in ASL. Remember that build in functions should not be used neither.
|
||||
|
||||
| Keyword |
|
||||
| - |
|
||||
| var |
|
||||
| if |
|
||||
| while |
|
||||
| witch |
|
||||
| for |
|
||||
| foreach |
|
||||
| func |
|
||||
| true |
|
||||
| false |
|
||||
| case |
|
||||
| default |
|
||||
| return |
|
||||
| try |
|
||||
| catch |
|
||||
| exitwith |
|
||||
| waituntil |
|
||||
|
||||
## Contribute
|
||||
|
||||
To contribute please create pull requests or explain your ideas in the issue section on GitHub. Report any bugs or incompatible ASL <-> SQF syntax you can find.
|
||||
|
||||
Reference in New Issue
Block a user