Identifier
The identifier of a contract element (parameter, variable, entrypoint, ...) is a string that starts with an alphabetic character (lower or upper case) followed by a string of alphanumeric characters (lower or upper case) or underscores. The maximum size of an identifier is 254. That is to say that an identifier verifies the following regular expression:
([A-Za-z][A-Za-z0-9_]*){1,254}
Keywords
A keyword is a reserved identifier that cannot be used as identifier, unless it is prefixed by the % character.
For example, transfer is the builtin instruction to call an external contract; in order to declare an entrypoint named transfer, prefix it with %:
entry %transfer() {
/* ... */
}
Below is the list of the language keywords.
addedaggregateandanyarchetypeasassertassetasset_viewatbeforebeginbig_mapbutbycallcalledcall_viewconstconstantcontractdefinitiondivdodo_fail_ifdonedo_requireeffectelseemitemptylistendentryentrypointenumeventexistsextensionfailfail iffailsfalsefoldforforallfromfunctiongetteridentifiedifininitialinitializedinvariantiterlabellambdaleftletlistmapmatchnamespacenonenotonoptionorotherwisepartitionasset_keypostconditionpredicaterecordrefremovedrequirerequire_entrypointreturnrightsapling_statesapling_transactionsecurityselfsetshadowsomesortedsourcedspecificationstatesthentickettotransfertransitiontruetypeunmovedunpackUnitusevarvariableviewwhenwhilewithxor