From d08a4f814a20544a403140b20516334b85f14623 Mon Sep 17 00:00:00 2001 From: Alessandro Coglio Date: Tue, 29 Mar 2022 21:20:26 -0700 Subject: [PATCH] [ABNF] Remove expression statements. Since we do not have tuple in this version of Leo, we cannot have expression statements, because normally expressions used as statements would have to return the empty tuple, since we disallow throwing away values in Leo. --- docs/grammar/README.md | 5 ++--- docs/grammar/abnf-grammar.txt | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/grammar/README.md b/docs/grammar/README.md index 1e10756188..f21fce5a8e 100644 --- a/docs/grammar/README.md +++ b/docs/grammar/README.md @@ -637,8 +637,7 @@ Go to: _[conditional-expression](#user-content-conditional-expression)_; ```abnf -statement = expression-statement - / return-statement +statement = return-statement / variable-declaration / constant-declaration / conditional-statement @@ -648,7 +647,7 @@ statement = expression-statement / block ``` -Go to: _[assignment-statement](#user-content-assignment-statement), [block](#user-content-block), [conditional-statement](#user-content-conditional-statement), [console-statement](#user-content-console-statement), [constant-declaration](#user-content-constant-declaration), [expression-statement](#user-content-expression-statement), [loop-statement](#user-content-loop-statement), [return-statement](#user-content-return-statement), [variable-declaration](#user-content-variable-declaration)_; +Go to: _[assignment-statement](#user-content-assignment-statement), [block](#user-content-block), [conditional-statement](#user-content-conditional-statement), [console-statement](#user-content-console-statement), [constant-declaration](#user-content-constant-declaration), [loop-statement](#user-content-loop-statement), [return-statement](#user-content-return-statement), [variable-declaration](#user-content-variable-declaration)_; diff --git a/docs/grammar/abnf-grammar.txt b/docs/grammar/abnf-grammar.txt index 21830a6f50..22c00b1a1a 100644 --- a/docs/grammar/abnf-grammar.txt +++ b/docs/grammar/abnf-grammar.txt @@ -262,8 +262,7 @@ conditional-expression = disjunctive-expression expression = conditional-expression -statement = expression-statement - / return-statement +statement = return-statement / variable-declaration / constant-declaration / conditional-statement