Skip to main content

identifiers

A name a declaration or a binding carries. It begins with a letter or an underscore, continues with letters, digits, and underscores, and its letters are ASCII.

const structure: int32 = 1;
const bit8: int32 = 8;
const uint8_new: int32 = 9;
const int032: int32 = 32;

Spelling​

The longest match wins, so a name that merely begins with a keyword, or with a width-suffixed type name, is an ordinary name.

  • structure, bit8, float321, and uint8_new are names. Only the exact spelling is taken as the keyword or the type, and a declaration cannot use it.
  • int032 is a name rather than a type, because a width does not carry a leading zero.
  • A lone _ is the discard token, not a name. A declaration cannot be called _.
  • Names are case-sensitive.
  • comments and whitespace — the text between names that means nothing.
  • module — the names in a file header, which bind nothing inside the file.
  • literals — the number, string, and bit forms a value is written in.