Skip to content

CASM Literals ​

CASM supports these literal forms:

FormExamplesNotes
Integer or decimal number0, -12, 3.5Decimal notation. A decimal point requires digits on both sides; scientific notation is not recognized.
Hexadecimal number0x2A, -0X10Requires at least one hexadecimal digit.
Booleantrue, falseLowercase only.
NullnullLowercase only.
Character'x', '\n', '\''Exactly one Unicode character after escapes are decoded.
String"hello", "line\n"Used by instructions that accept a quoted string.

Quoted forms recognize the escapes \\, \', \", \n, \r, \t, and \0. They cannot continue across a newline. Unknown escape sequences are rejected.

The load_const instruction accepts number, boolean, character, or null literals. Non-negative integer numbers from 0 through 255 are encoded as Byte values; other numbers are encoded as Number. Use str_new to construct a runtime String from a quoted literal.

Built for the Candle ecosystem · Powered by VitePress.