Keywords

There are three keyword categories:

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
ref
return
struct
trait
true
type
use

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
pub
self
static
static_assert
super
try
typeof
unsafe
where
while
with
yield

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.