Language Reference
Keywords and Lexical Forms
Reserved words, literal forms, comments, and identifier rules visible in the active lexer.
Keywords
| Keyword | Role | Design reference |
|---|---|---|
function |
Declares a named function and its signature. | Raz syntax; lineage not formally recorded |
struct |
Declares a type with named fields. | C struct concept |
let |
Declares a mutable binding; type may be inferred or explicit. |
Rust let as naming reference; Raz rules differ
|
const |
Declares a binding that cannot be reassigned. | C/C++ const concept |
return |
Returns a value or exits a return context. | C-family syntax |
if, else |
Conditional branch and alternative branch. | C-family syntax |
while |
Conditional loop. | C-family syntax |
true, false |
Boolean literals. | C++ / Rust-style spelling |
new |
Requests construction of a typed value. | C++-influenced spelling; not assumed to mean heap allocation |
use |
Imports a Raz module or a quoted native C++ header. | Rust use concept, adapted for Raz |
include |
Expands another Raz source file during compilation. | |
unsafe |
Marks a region permitting restricted unsafe constructs. | Rust unsafe concept, adapted |
nullptr |
Null pointer literal. | C++ nullptr |
define |
Declares a parameterized source macro. | Raz-specific; not the C preprocessor |
Inconsistent handling: the parser has an
extern-related token check, but the lexer does not
currently emit a token for the word extern. It is
therefore not listed as a supported keyword.
Identifiers and literals
| Form | Current behavior |
|---|---|
| Identifier | ASCII letters or underscore, followed by ASCII letters, digits, or underscore. |
| Number |
Digits, optionally followed by a dot and more digits;
decimal form is inferred as f64.
|
| String |
Double-quoted. Common escapes include \n,
\t, and \r.
|
| Character | Single-quoted, represented internally by a numeric character code. Full Unicode/code-point behavior is not specified. |
| Line comment | // comment — skipped by the lexer. |
| Block comment | /* comment */ — skipped by the lexer. |
Lexical questions
Unknown characters currently fall through to token kind
99. Whether this becomes a mandatory lexer error, and
how escape sequences are validated, must be specified before this
behavior is treated as a public guarantee.