Keywords
Keywords known to the current Zynx lexer.
The current lexer recognizes these keyword tokens:
| Category | Keywords |
|---|---|
| Declarations | fn, struct, enum, interface, error, type, test |
| Modules and linkage | import, from, export, extern, foreign |
| Bindings | let, const, distinct |
| Control flow | if, else, for, in, while, loop, match, select, case, return, break, continue, defer |
| Error flow | try, throw, catch, throws, assert |
| Async | async, await |
| Low-level | asm, as, unsafe, with, intrinsic |
| Reserved or lexer-known | union |
import std.os;
fn main() {
let value = 42;
if value > 0 {
_ = os.write("{value}\n");
}
}
Not every lexer-known keyword has a finalized public syntax page yet.