From 4cce09d5c8a102b61a15c22472574451bb6e2f73 Mon Sep 17 00:00:00 2001 From: Alessandro Coglio Date: Mon, 28 Mar 2022 12:26:36 -0700 Subject: [PATCH] [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. --- docs/grammar/README.md | 2 +- docs/grammar/abnf-grammar.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/grammar/README.md b/docs/grammar/README.md index 1e10756188..9009917743 100644 --- a/docs/grammar/README.md +++ b/docs/grammar/README.md @@ -778,7 +778,7 @@ Go to: _[print-arguments](#user-content-print-arguments), [print-function](#user ```abnf function-declaration = %s"function" identifier - "(" [ function-parameters ] ")" [ "->" type ] + "(" [ function-parameters ] ")" "->" type block ``` diff --git a/docs/grammar/abnf-grammar.txt b/docs/grammar/abnf-grammar.txt index 21830a6f50..c556bf5467 100644 --- a/docs/grammar/abnf-grammar.txt +++ b/docs/grammar/abnf-grammar.txt @@ -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 ) [ "," ]