Add main contract, contract interface, and guards to the docs syntax

This commit is contained in:
Gaith Hallak 2022-08-03 00:10:44 +04:00
parent 4dbc9858fb
commit 6ff8463db4

View File

@ -91,7 +91,8 @@ A Sophia file consists of a sequence of *declarations* in a layout block.
```c
File ::= Block(TopDecl)
TopDecl ::= ['payable'] 'contract' Con '=' Block(Decl)
TopDecl ::= ['payable'] ['main'] 'contract' Con '=' Block(Decl)
| 'contract' 'interface' Con '=' Block(Decl)
| 'namespace' Con '=' Block(Decl)
| '@compiler' PragmaOp Version
| 'include' String
@ -103,6 +104,9 @@ Decl ::= 'type' Id ['(' TVar* ')'] '=' TypeAlias
FunDecl ::= Id ':' Type // Type signature
| Id Args [':' Type] '=' Block(Stmt) // Definition
| Id Args [':' Type] Block(GuardedDef) // Guarded definitions
GuardedDef = '|' Sep(Expr, ',') '=' Block(Stmt)
PragmaOp ::= '<' | '=<' | '==' | '>=' | '>'
Version ::= Sep1(Int, '.')