Docs / Lexicography
2. Lexical Structure
Dryad's lexical structure is end-to-end Unicode (UTF-8). The alphabet consists of letters [a-zA-Z], digits [0-9], insignificant whitespace (except in literals and template strings), and special characters. The lexer ensures ambiguity-free interpretation.
| Category | Reserved Words |
|---|---|
| Declaration | let, const |
| Flow Control | if, else, for, while, do, break, continue, match, in |
| Functions & Tasks | function, fn, async, await, return, thread, mutex |
| Object Orientation | class, new, extends, this, super, static, public, private, protected |
| Modules & FFI | import, export, use, as, from |
| Exceptions | try, catch, finally, throw |
| Basic Literals | true, false, null |
Native Directives and Delimiters
1 #io // Token NativeDirective("io") 2 let hex = 0xFF; // Literal hexadecimal 3 let bin = 0b1010; // Binary literal 4 let octal = 0o755; // Octal literal 5
Dryad supports numbers in decimal, hexadecimal, binary, and octal formats.
Found an error in the spec? Open a PR.
Official Version: 1.0 · May 2026