Lexical Structure
Keywords
- Directives/Declarators:
importclass,struct,enum,interface,mixin,unittest - Access Control:
public,private,module,package - Storage Classes:
meta,ref,out,scope - Control Flow:
for,loop,break,continue,return,throw,try,catch, - Built-In Values:
this,super,null,true,false - Basic Types:
type,void,bool,byte,ubyte,short,ushort,int,uint,long,ulong,size,sizediff,float,double,real,char,wchar,dchar - Type Qualifiers:
isolated,escape,immutable,const,shared,synchronized - Type Casting:
cast
Punctuation
- Operators:
&&,||,?,!,~,+,-,*,/,%,&,|,^,^^,<<,>>,=,+=,-=,*=,/=,%=,&=,|=,^=,~=,^^=,<<=,>>=,++,--,==,!=,<=,<,>,>=,<>,is,!is,=>,[,] - Delimiters:
.,:,,,;,(,),{,} - Other:
$,#,@
Identifiers
Identifiers must start with an alphabetic Unicode character or with an
underscore (_) and can contain any number of alpanumeric characters and
underscores. An identifier cannot be identical to one of the keywords listed
above.
Identifiers starting with two consecutive underscores (__) are reserved to
the language/runtime implementation and should not be used for user defined
symbols. Unless explicitly specified, the name of symbols starting with two
underscores is implementation defined.
Constant Literals
true: Value of typeboolequivalent to onefalse: Value of typeboolequivalent to zeronull: Value of typetypeof(null)representing a pointer to the zero address, which is equivalent to a pointer to "nothing"
Numeric Literals
The following types of numeric literals are available:
- Decimal Integers: These consist of either a single zero (
0), or a non-zero digit followed by zero or more digits. - Hexadecimal Integers: ❌ Not Implemented
- Decimal Floating-Point Numbers: ❌ Not Implemented
String Literals
- Escaped Strings: ⚠️ TODO/❌ Not Fully Implemented
- Interpolated Strings: ⚠️ TODO
- RAW Strings: Raw strings are arbitrary character sequences delimited by a backtick character. No escaping or string interpolation is performed on the contained character sequence.