>>
scans into a shift right token, not two greater than tokens.
EndOfFile: end of the file \u0000 \u001AThe source text is terminated by whichever comes first.
EndOfLine: \u000D \u000A \u000D \u000A EndOfFileThere is no backslash line splicing, nor are there any limits on the length of a line.
White space is defined as a sequence of one or more of the following:
Comment: /* characters */ // characters EndOfLineD has two kinds of comments, the block comment and the line comment. Block comments can span multiple lines, line comments only one. Comments do not nest. Comments cannot be used as token concatenators, for example,
abc/**/def
is two tokens, abc and def,
not one abcdef token.
Single quoted strings are enclosed by ''. All characters between the '' are part of the string, there are no escape sequences inside '':
'hello' 'c:\root\foo.exe' 'ab\n' string is 4 characters, 'a', 'b', '\', 'n'Double quoted strings are enclosed by "". Escape sequences can be embedded into them with the typical \ notation.
"hello" "c:\\root\\foo.exe" "ab\n" string is 3 characters, 'a', 'b', and a linefeedEscape strings start with a \ and form an escape character sequence. Adjacent escape strings are concatenated:
\n the linefeed character \t the tab character \" the double quote character \0123 octal \x1A hex \u1234 wchar character \r\n carriage return, line feedAdjacent strings are concatenated with the ~ operator, or by simple juxtaposition:
"hello " ~ "world" ~ \n // forms the string 'h','e','l','l','o',' ','w','o','r','l','d',linefeedThe following are all equivalent:
"ab" "c" 'ab' 'c' 'a' "bc" "a" ~ "b" ~ "c" \0x61"bc"
Integers can be specified in decimal, binary, octal, or hexadecimal.
Decimal integers are a sequence of decimal digits.
Binary integers are a sequence of binary digits preceded by a '0b'.
Octal integers are a sequence of octal digits preceded by a '0'.
Hexadecimal integers are a sequence of hexadecimal digits preceded by a '0x' or followed by an 'h'.
Integers can be immediately followed by one 'l' or one 'u' or both.
The type of the integer is resolved as follows:
1) If it is decimal it is the last representable of ulong, long, or int.
2) If it is not decimal, it is the last representable of ulong, long, uint, or int.
3) If it has the 'u' suffix, it is the last representable of ulong or uint.
4) If it has the 'l' suffix, it is the last representable of ulong or long.
5) If it has the 'u' and 'l' suffixes, it is ulong.
Hexadecimal floats are preceded with a '0x' and the exponent is a 'p' or 'P' followed by a power of 2.
Floats can be followed by one 'f', 'F', 'l' or 'L' suffix. The 'f' or 'F' suffix means it is a float, and 'l' or 'L' means it is an extended.
If a floating literal is followed by 'i', then it is an imaginary type.
Examples:
0x1.FFFFFFFFFFFFFp1023 // double.max 0x1p-52 // double.epsilon 1.175494351e-38F // float.min 6.3i // imaginary 6.3Complex literals are not tokens, but are assembled from real and imaginary expressions in the semantic analysis:
4.5 + 6.2i // complex number
Keyword: this super assert null true false cast new delete throw void byte ubyte short ushort int uint long ulong float double extended bit char ascii wchar imaginary complex if else while for do switch case default break continue synchronized return goto try catch finally with struct class interface union enum import static final const typedef typealias override abstract volatile debug deprecated in out inout align extern private protected public export body invariant