From a589adeafea79e3bd47593b457d66f2cfa96fe2c Mon Sep 17 00:00:00 2001 From: Gaith Hallak Date: Wed, 3 Aug 2022 15:10:57 +0400 Subject: [PATCH] Add polymorphism implmented interface syntax --- docs/sophia_syntax.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/sophia_syntax.md b/docs/sophia_syntax.md index 08dbee3..87b1bee 100644 --- a/docs/sophia_syntax.md +++ b/docs/sophia_syntax.md @@ -91,12 +91,14 @@ A Sophia file consists of a sequence of *declarations* in a layout block. ```c File ::= Block(TopDecl) -TopDecl ::= ['payable'] ['main'] 'contract' Con '=' Block(Decl) - | 'contract' 'interface' Con '=' Block(Decl) - | 'namespace' Con '=' Block(Decl) - | '@compiler' PragmaOp Version - | 'include' String - | Using +TopDecl ::= ['payable'] ['main'] 'contract' Con [Implement] '=' Block(Decl) + | 'contract' 'interface' Con [Implement] '=' Block(Decl) + | 'namespace' Con '=' Block(Decl) + | '@compiler' PragmaOp Version + | 'include' String + | Using + +Implement ::= ':' Sep1(Con, ',') Decl ::= 'type' Id ['(' TVar* ')'] '=' TypeAlias | 'record' Id ['(' TVar* ')'] '=' RecordType