mirror of
https://github.com/AleoHQ/leo.git
synced 2024-12-19 23:52:02 +03:00
[ABNF] Require function output type.
Since this pre-testnet3 version of Leo does not support tuple types, and since a missing function type is meant to be interpreted as the empty tuple type `()` in future versions of Leo, it seems appropriate to require a function output type in this version of Leo. We could instead default to a different type (e.g. bool), but it seems cleaner to require it for now, and make it optional later.
This commit is contained in:
parent
88c1bfd8a3
commit
4cce09d5c8
@ -778,7 +778,7 @@ Go to: _[print-arguments](#user-content-print-arguments), [print-function](#user
|
||||
<a name="function-declaration"></a>
|
||||
```abnf
|
||||
function-declaration = %s"function" identifier
|
||||
"(" [ function-parameters ] ")" [ "->" type ]
|
||||
"(" [ function-parameters ] ")" "->" type
|
||||
block
|
||||
```
|
||||
|
||||
|
@ -310,7 +310,7 @@ print-arguments = "(" string-literal *( "," expression ) [ "," ] ")"
|
||||
print-call = print-function print-arguments
|
||||
|
||||
function-declaration = %s"function" identifier
|
||||
"(" [ function-parameters ] ")" [ "->" type ]
|
||||
"(" [ function-parameters ] ")" "->" type
|
||||
block
|
||||
|
||||
function-parameters = function-parameter *( "," function-parameter ) [ "," ]
|
||||
|
Loading…
Reference in New Issue
Block a user