Grammar

Grammar Notation

Result  ::= component1 ( component2 | component3 ) | 
            component4 | [component5] component6
- /* comments */
- 'literal'
- (A|B): either of A or B
- A B: A then B
- [A]: Optional A
- (A)* : Repeating A zero or more times
- (A)+ : Repeating A one or more times
- {A}*  : Repeating A zero or more times, separated with comma
- {A}+  : Repeating A one or more times, separated with comma

Top-level

A module is a series of types (named or alias) or bindings (value or function).

Module                   ::= ( TypeDecl | BindingDecl )*

Naming basics

TypeName                ::= CAPITAL_LETTER (ALPHABET)*
BindingName             ::= ValueBindingName | TypeName | FunctionName
ValueBidningName        ::= (LOWERCASE) (LOWECASE | '_')*
FunctionName            ::= LOWERCASE (LOWERCASE | CAPITAL_LETTER)*
ModuleAlias             ::= ValueBidningName

Type Declaration

Declaration of a named type or type alias

Binding Declaration

Types of expressions you can define by combining other expressions (mathematical, struct access, boolean, a function call, ...).

To Be Added Later

  • Generics

  • Concurrency and channels

  • Modules and import

Last updated

Was this helpful?