Keywords
AdeshLang documents 84 language keywords here. Every identifier that matches one of these spellings is tokenized as the corresponding keyword token rather than as an ordinary identifier, so none of them may be used as a variable, function, type, or parameter name.
Each keyword below links to a reference with an explanation, syntax/example, and use cases.
Reserved keywords by category
| # | Keyword | Category | Summary | Page |
|---|---|---|---|---|
| 1 | type | Type System & Declarations | Declares a type alias or custom type. | type |
| 2 | abstract | Type System & Declarations | Marks a type/member as abstract (no direct instantiation). | abstract |
| 3 | sealed | Type System & Declarations | Restricts subtyping to a closed set. | sealed |
| 4 | interface | Type System & Declarations | Declares an interface (contract). | interface |
| 5 | implements | Type System & Declarations | Declares that a type implements an interface. | implements |
| 6 | struct | Type System & Declarations | Declares a structure type. | struct |
| 7 | enum | Type System & Declarations | Declares an enumeration. | enum |
| 8 | let | Type System & Declarations | Binds a variable (immutable by default). | let |
| 9 | const | Type System & Declarations | Declares a compile-time constant. | const |
| 10 | fn | Type System & Declarations | Declares a function. | fn |
| 11 | return | Control Flow | Returns a value from a function. | return |
| 12 | if | Control Flow | Conditional branch. | if |
| 13 | else | Control Flow | Alternative branch of if. | else |
| 14 | elif | Control Flow | Else-if chain branch. | elif |
| 15 | do | Control Flow | do...while loop body introducer. | do |
| 16 | while | Control Flow | Conditional loop. | while |
| 17 | break | Control Flow | Exits the nearest loop. | break |
| 18 | continue | Control Flow | Skips to the next loop iteration. | continue |
| 19 | jump | Control Flow | Unconditional/local jump (context-specific). | jump |
| 20 | extend | Object-Oriented Programming | Retroactive extension — extend on Type / extend Name on Type (no VTable, monomorphic). | extend |
| 21 | extends | Object-Oriented Programming | Single-inheritance class header — class Dog extends Animal. | extends |
| 22 | extern | FFI & Linkage | Declares external/FFI linkage. | extern |
| 23 | private | Object-Oriented Programming | Most restrictive visibility modifier. | private |
| 24 | protected | Object-Oriented Programming | Inheritance-aware visibility modifier. | protected |
| 25 | public | Object-Oriented Programming | Fully visible access modifier. | public |
| 26 | super | Object-Oriented Programming | References the parent type/member. | super |
| 27 | on | Object-Oriented Programming | Mandatory target marker in extend … on Type. | on |
| 28 | for | Control Flow | Iterator loop. | for |
| 29 | in | Control Flow | Iteration membership clause. | in |
| 30 | of | Control Flow | Value-iteration clause. | of |
| 31 | true | Boolean & Null Literals | Boolean true literal. | true |
| 32 | false | Boolean & Null Literals | Boolean false literal. | false |
| 33 | null | Boolean & Null Literals | Null reference literal. | null |
| 34 | and | Logical & Type Operators | Logical AND operator. | and |
| 35 | or | Logical & Type Operators | Logical OR operator. | or |
| 36 | not | Logical & Type Operators | Logical NOT operator. | not |
| 37 | instanceof | Logical & Type Operators | Runtime type test. | instanceof |
| 38 | typeof | Logical & Type Operators | Compile-time type query. | typeof |
| 39 | class | Object-Oriented Programming | Declares a class. | class |
| 40 | new | Object-Oriented Programming | Allocates/constructs an instance. | new |
| 41 | this | Object-Oriented Programming | Reference to the current instance. | this |
| 42 | self | Object-Oriented Programming | Reference to the current type/self receiver. | self |
| 43 | uint | Primitive Type Keywords | Unsigned integer type keyword. | uint |
| 44 | int | Primitive Type Keywords | Signed integer type keyword. | int |
| 45 | Int | Primitive Type Keywords | Case-sensitive alias mapping to the integer type token. | Int |
| 46 | static | Object-Oriented Programming | Member is associated with the type, not an instance. | static |
| 47 | constructor | Object-Oriented Programming | Lexed but rejected by the parser; use the class name instead. | constructor |
| 48 | get | Object-Oriented Programming | Property getter accessor. | get |
| 49 | set | Object-Oriented Programming | Property setter accessor. | set |
| 50 | operator | Object-Oriented Programming | Declares an overloaded operator. | operator |
| 51 | import | Modules & Imports | Imports a module or symbol. | import |
| 52 | as | Modules & Imports | Renames an imported/converted symbol. | as |
| 53 | export | Modules & Imports | Exports a symbol from a module. | export |
| 54 | from | Modules & Imports | Names the source module in an import. | from |
| 55 | default | Modules & Imports | Default export/import. | default |
| 56 | try | Error Handling | Begins a protected block. | try |
| 57 | catch | Error Handling | Catches a thrown error. | catch |
| 58 | throw | Error Handling | Raises an error. | throw |
| 59 | async | Async & Concurrency | Marks a function/value as asynchronous. | async |
| 60 | await | Async & Concurrency | Awaits an async value. | await |
| 61 | spawn | Async & Concurrency | Spawns a concurrent task. | spawn |
| 62 | match | Control Flow | Pattern-matching expression. | match |
| 63 | decorator | Metaprogramming & Compile-time | Declares/attaches a decorator. | decorator |
| 64 | readonly | Object-Oriented Programming | Marks a field as read-only. | readonly |
| 65 | raw | Metaprogramming & Compile-time | Raw string/verbatim marker. | raw |
| 66 | vec | Primitive Type Keywords | Vector type keyword. | vec |
| 67 | region | Memory & Safety | Declares a memory region. | region |
| 68 | defer | Memory & Safety | Schedules scope-exit cleanup. | defer |
| 69 | unsafe | Memory & Safety | Marks an unchecked/unsafe block. | unsafe |
| 70 | share | Memory & Safety | Shares a reference. | share |
| 71 | strong | Memory & Safety | Strong reference qualifier. | strong |
| 72 | weak | Memory & Safety | Weak reference qualifier. | weak |
| 73 | alloc | Memory & Safety | Allocates memory. | alloc |
| 74 | free | Memory & Safety | Frees memory. | free |
| 75 | compile | Metaprogramming & Compile-time | Compile-time evaluation block. | compile |
| 76 | runtime | Metaprogramming & Compile-time | Runtime-evaluation block/marker. | runtime |
| 77 | typecheck | Metaprogramming & Compile-time | Compile-time type assertion. | typecheck |
| 78 | emit | Metaprogramming & Compile-time | Emits code/directive. | emit |
| 79 | require | Metaprogramming & Compile-time | Compile-time precondition. | require |
| 80 | test | Testing | Declares a test. | test |
| 81 | ignore | Testing | Marks a test to be ignored. | ignore |
| 82 | expect_fail | Testing | Marks a test expected to fail. | expect_fail |
| 83 | proceed | Metaprogramming & Compile-time | Decorator continuation — call.proceed() inside runtime phase. | proceed |
| 84 | _ | Wildcard / Placeholder | Wildcard/placeholder token (not an identifier). | _ (underscore) |
Special directive: $cImport
In addition to the 84 documented keywords above, the lexer recognizes a single special directive, $cImport, which is tokenized as the CImport token and used for FFI/C interop. It is not counted among the 84 identifier keywords because it begins with $ and is not part of the identifier-keyword mapping table. See FFI for usage.
$cImport "stdio.h";
Notes on parser support
Several reserved tokens have narrow or context-specific parser support in the current implementation. Where that is the case, the dedicated page says so explicitly:
constructoris lexed as a keyword but the parser explicitly rejects it. The supported constructor form is a method named after the class. See constructor._is a wildcard/placeholder token, not an ordinary identifier, and cannot be used as a binding name in the usual way. See _ (underscore).Intis case-sensitive and distinct fromint; both map to the same integer-type token. See Int.- A number of memory-safety and metaprogramming keywords (
region,share,strong,weak,alloc,free,compile,runtime,typecheck,emit,require,jump) are reserved for current or experimental features and may have limited parser support. extendwithouton— writingextend Type { … }is a compile error; always useextend on Typeorextend Name on Type. See extend and on.proceedis only meaningful ascall.proceed()inside a decoratorruntime(call)phase. See proceed.