Identifiers & Datatypes

Upper and lowercase letters carry different meaning when at the start of a word.

A Datatype must always start with an uppercase letter, and an identifier must start with either a lowercase letter or an underscore.

Identifier

Identifier        = (underscore | lowercase_letter), identifier_letter*

identifier_letter = underscore | lowercase_letter | uppercase_letter | decimal_digit

identifier
╰╴No statement matched
_identifier _123 _many_letters camelCase
thp

Datatype

Datatype = uppercase_letter, indentifier_letter*

Datatype
╰╴No statement matched
PDO WEIRD_DATATYPE
thp

Keywords

The following are (currently) THP keywords:


val     var     fun
╰╴No statement matched
thp

Keywords are scanned first as identifiers, then transformed to their respective tokens.