Keywords

There are three keyword categories:

1. Strict keywords

These keywords can only be used in their correct contexts. They cannot be used as names of any items.

as
break
const
continue
else
enum
extern
false
fn
if
impl
implicits
let
loop
match
mod
mut
nopanic
of
pub
ref
return
struct
trait
true
type
use
while

2. Reserved keywords

These keywords aren’t used yet, but they are reserved for future use. They have the same restrictions as strict keywords. The reasoning behind this is to make current programs forward compatible with future versions of Cairo by forbidding them to use these keywords.

Self
assert
do
dyn
for
hint
in
macro
move
self
static
static_assert
super
try
typeof
unsafe
where
with
yield

3. Contextual keywords

Some grammar productions may make use of new keywords not listed here. Such keywords have special meaning only in these certain contexts. Outside these places, these character sequences are treated as regular identifiers, thus it is possible to declare a function or variable with such names.

No contextual keywords are in use as for now.