LogoMist

Syntax Overview

Comments, literals, identifiers, and keywords in Mist.

Comments

// Line comments only

Literals

42              // Integer
3.14            // Float
true            // Boolean
false           // Boolean
"hello"         // String
(1, true, "x")  // Tuple
[1, 2, 3]       // Array

Identifiers & Keywords

Keywords are reserved and cannot be used as identifiers:

if, else, fn, for, while, match, return, break, continue, struct, enum, class, trait, impl, use, pub, mut, let, true, false, dyn, loop, unsafe, override, const, type, virtual

Identifiers follow the pattern [a-zA-Z_][a-zA-Z0-9_]*.

Visibility

// Private (default)
void internal() { }

// Public
pub void external() { }

// Public to specific path
pub(crate) void crate_only() { }
pub(super) void parent_only() { }
pub(my::module) void module_only() { }

On this page