Skip to main content

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.

Case sensitivity

Keyword matching is case sensitive. int and Int are two distinct reserved spellings (both map to the same integer-type token), and Int is reserved separately from the lowercase int. See int and Int.

Reserved keywords by category

#KeywordCategorySummaryPage
1typeType System & DeclarationsDeclares a type alias or custom type.type
2abstractType System & DeclarationsMarks a type/member as abstract (no direct instantiation).abstract
3sealedType System & DeclarationsRestricts subtyping to a closed set.sealed
4interfaceType System & DeclarationsDeclares an interface (contract).interface
5implementsType System & DeclarationsDeclares that a type implements an interface.implements
6structType System & DeclarationsDeclares a structure type.struct
7enumType System & DeclarationsDeclares an enumeration.enum
8letType System & DeclarationsBinds a variable (immutable by default).let
9constType System & DeclarationsDeclares a compile-time constant.const
10fnType System & DeclarationsDeclares a function.fn
11returnControl FlowReturns a value from a function.return
12ifControl FlowConditional branch.if
13elseControl FlowAlternative branch of if.else
14elifControl FlowElse-if chain branch.elif
15doControl Flowdo...while loop body introducer.do
16whileControl FlowConditional loop.while
17breakControl FlowExits the nearest loop.break
18continueControl FlowSkips to the next loop iteration.continue
19jumpControl FlowUnconditional/local jump (context-specific).jump
20extendObject-Oriented ProgrammingRetroactive extension — extend on Type / extend Name on Type (no VTable, monomorphic).extend
21extendsObject-Oriented ProgrammingSingle-inheritance class header — class Dog extends Animal.extends
22externFFI & LinkageDeclares external/FFI linkage.extern
23privateObject-Oriented ProgrammingMost restrictive visibility modifier.private
24protectedObject-Oriented ProgrammingInheritance-aware visibility modifier.protected
25publicObject-Oriented ProgrammingFully visible access modifier.public
26superObject-Oriented ProgrammingReferences the parent type/member.super
27onObject-Oriented ProgrammingMandatory target marker in extend … on Type.on
28forControl FlowIterator loop.for
29inControl FlowIteration membership clause.in
30ofControl FlowValue-iteration clause.of
31trueBoolean & Null LiteralsBoolean true literal.true
32falseBoolean & Null LiteralsBoolean false literal.false
33nullBoolean & Null LiteralsNull reference literal.null
34andLogical & Type OperatorsLogical AND operator.and
35orLogical & Type OperatorsLogical OR operator.or
36notLogical & Type OperatorsLogical NOT operator.not
37instanceofLogical & Type OperatorsRuntime type test.instanceof
38typeofLogical & Type OperatorsCompile-time type query.typeof
39classObject-Oriented ProgrammingDeclares a class.class
40newObject-Oriented ProgrammingAllocates/constructs an instance.new
41thisObject-Oriented ProgrammingReference to the current instance.this
42selfObject-Oriented ProgrammingReference to the current type/self receiver.self
43uintPrimitive Type KeywordsUnsigned integer type keyword.uint
44intPrimitive Type KeywordsSigned integer type keyword.int
45IntPrimitive Type KeywordsCase-sensitive alias mapping to the integer type token.Int
46staticObject-Oriented ProgrammingMember is associated with the type, not an instance.static
47constructorObject-Oriented ProgrammingLexed but rejected by the parser; use the class name instead.constructor
48getObject-Oriented ProgrammingProperty getter accessor.get
49setObject-Oriented ProgrammingProperty setter accessor.set
50operatorObject-Oriented ProgrammingDeclares an overloaded operator.operator
51importModules & ImportsImports a module or symbol.import
52asModules & ImportsRenames an imported/converted symbol.as
53exportModules & ImportsExports a symbol from a module.export
54fromModules & ImportsNames the source module in an import.from
55defaultModules & ImportsDefault export/import.default
56tryError HandlingBegins a protected block.try
57catchError HandlingCatches a thrown error.catch
58throwError HandlingRaises an error.throw
59asyncAsync & ConcurrencyMarks a function/value as asynchronous.async
60awaitAsync & ConcurrencyAwaits an async value.await
61spawnAsync & ConcurrencySpawns a concurrent task.spawn
62matchControl FlowPattern-matching expression.match
63decoratorMetaprogramming & Compile-timeDeclares/attaches a decorator.decorator
64readonlyObject-Oriented ProgrammingMarks a field as read-only.readonly
65rawMetaprogramming & Compile-timeRaw string/verbatim marker.raw
66vecPrimitive Type KeywordsVector type keyword.vec
67regionMemory & SafetyDeclares a memory region.region
68deferMemory & SafetySchedules scope-exit cleanup.defer
69unsafeMemory & SafetyMarks an unchecked/unsafe block.unsafe
70shareMemory & SafetyShares a reference.share
71strongMemory & SafetyStrong reference qualifier.strong
72weakMemory & SafetyWeak reference qualifier.weak
73allocMemory & SafetyAllocates memory.alloc
74freeMemory & SafetyFrees memory.free
75compileMetaprogramming & Compile-timeCompile-time evaluation block.compile
76runtimeMetaprogramming & Compile-timeRuntime-evaluation block/marker.runtime
77typecheckMetaprogramming & Compile-timeCompile-time type assertion.typecheck
78emitMetaprogramming & Compile-timeEmits code/directive.emit
79requireMetaprogramming & Compile-timeCompile-time precondition.require
80testTestingDeclares a test.test
81ignoreTestingMarks a test to be ignored.ignore
82expect_failTestingMarks a test expected to fail.expect_fail
83proceedMetaprogramming & Compile-timeDecorator continuation — call.proceed() inside runtime phase.proceed
84_Wildcard / PlaceholderWildcard/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:

  • constructor is 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).
  • Int is case-sensitive and distinct from int; 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.
  • extend without on — writing extend Type { … } is a compile error; always use extend on Type or extend Name on Type. See extend and on.
  • proceed is only meaningful as call.proceed() inside a decorator runtime(call) phase. See proceed.