Update Sophia syntax docs to include missing information about existing syntax #896

Merged
ghallak merged 9 commits from ghallak/docs-update into master 2022-08-04 05:25:42 +09:00
Showing only changes of commit a589adeafe - Show all commits

View File

@ -91,13 +91,15 @@ A Sophia file consists of a sequence of *declarations* in a layout block.
```c ```c
File ::= Block(TopDecl) File ::= Block(TopDecl)
TopDecl ::= ['payable'] ['main'] 'contract' Con '=' Block(Decl) TopDecl ::= ['payable'] ['main'] 'contract' Con [Implement] '=' Block(Decl)
| 'contract' 'interface' Con '=' Block(Decl) | 'contract' 'interface' Con [Implement] '=' Block(Decl)
| 'namespace' Con '=' Block(Decl) | 'namespace' Con '=' Block(Decl)
| '@compiler' PragmaOp Version | '@compiler' PragmaOp Version
| 'include' String | 'include' String
| Using | Using
Implement ::= ':' Sep1(Con, ',')
Decl ::= 'type' Id ['(' TVar* ')'] '=' TypeAlias Decl ::= 'type' Id ['(' TVar* ')'] '=' TypeAlias
| 'record' Id ['(' TVar* ')'] '=' RecordType | 'record' Id ['(' TVar* ')'] '=' RecordType
| 'datatype' Id ['(' TVar* ')'] '=' DataType | 'datatype' Id ['(' TVar* ')'] '=' DataType