-
Notifications
You must be signed in to change notification settings - Fork 0
/
tokens.txt
201 lines (187 loc) · 2.97 KB
/
tokens.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
// Comment
/* Multiline comment */
// Primitive type keywords
u8 // unsigned 8-bit
u16 // unsigned 16-bit
u32 // unsigned 32-bit
u64 // unsigned 64-bit
s8 // signed 8-bit
s16 // signed 16-bit
s32 // signed 32-bit
s64 // signed 64-bit
f32 // floating point single precision
f64 // floating point double precision
c8 // character 8-bit
c16 // character 16-bit
c32 // character 32-bit
b8 // generic 8-bit data
b16 // generic 16-bit data
b32 // generic 32-bit data
b64 // generic 64-bit data
void
bool
err
any // any type
type // type type
no_return
null_type
struct
union
enum
fun // function
infer
// Box keywords
let // variable
def // define
mut // mutable
ref // reference
align // Align box
// Control flow keywords
if
then
else
while
loop
for
match
case
break
continue
yield
try
catch
raise
// Operator keywords
typeof
sizeof
as
is
and
or
not
// Literal keywords
true
false
null
nothing
never
self
Self
// Other keywords
import
export
alias
pub
const // Means Compile-time, not immutable
inline
delete
copy
move
_
namespace
// Reserved keywords
extern
defer
async
await
static
dynamic
asm // assembly block
operator
in
gen // Generator
lambda
unsafe
from
// Symbols
+ // Add, Shared pointer
++ // Increment
- // Negate, subtract
-- // Decrement
= // Assign
== // Equals
!= // Not equals
> // Greater than
>> // Shift right
< // Less than
<< // Shift left
>= // Greater or equal than
<= // Less or equal than, strong arrow left
=> // Strong arrow right
( // Open paren
) // Close paren
{ // Open brace
} // Close brace
'{ // Open struct literal
({ // Open expression block
}) // Close expression block
[ // Open bracket
] // Close bracket
'[ // Open array literal
, // Comma
. // Access
.. // Concatenate
... // Spread, destructure
// .{ // Swizzle psudo-operator
// .[ // Constant access pseudo-operator
: // Of type
:: // Select
// ::* // Select all pseudo-operator
// ::{ // Select multiple pseudo-operator
-> // Return type, Arrow right
<- // Move, Arrow left
! // Bitwise not
!! // Logical not
@ // Dereference
# // Hash
% // Modulo
^ // Binary xor
^^ // Logical xor
& // Binary and
&& // Logical and
| // Binary or
|| // Logical or
@^ // Flip bit at
@& // Unset bit at
@| // Set bit at
@? // Check bit at
* // Pointer to, multiply, address of
~ // Info
; // Semicolon
/ // Divide
? // Propagate
<> // Diamond
~> // Weak arrow right
<~ // Weak arrow left
|> // Pipe right
<| // Pipe left
?? // Nullish coalescence
+= // Plus equals
-= // Minus equals
*= // Times equals
/= // Divide equals
%= // Modulo equals
<<= // Shl equals
>>= // Shr equals
&= // And equals
|= // Or equals
^= // Xor equals
@^= // Flip bit equals
@&= // Clear bit equals
@|= // Set bit equals
..= // Concatenate equals
// Literals (regexish)
0x[0-9a-fA-F]+ // Hexadecimal
0o[0-7]+ // Octal
0b[01]+ // Binary
\d(\d|_\d|'\d)* // Decimal
\d(\d|_\d|'\d)*\.\d(\d|_\d|'\d)* // Float
\\. // Char
[_a-zA-Z][_a-zA-Z0-9]+' // Identifier literal
"([^"]|`")+" // String literal
// Identifiers
[_a-zA-Z][_a-zA-Z0-9]+
$"([^"]|`")+"
// Notes
$[
$[_a-zA-Z0-9]+