From 137a6842181c353e8d76a9872be996dbc6d6f850 Mon Sep 17 00:00:00 2001 From: Ondra Pelech Date: Sun, 5 Mar 2023 02:12:56 +0100 Subject: [PATCH] Documentation: principle of optional braces --- docs/_docs/reference/syntax.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/_docs/reference/syntax.md b/docs/_docs/reference/syntax.md index 8da41c7e6d0c..6abc3b2011d1 100644 --- a/docs/_docs/reference/syntax.md +++ b/docs/_docs/reference/syntax.md @@ -105,7 +105,10 @@ semi ::= ‘;’ | nl {nl} ## Optional Braces -The lexical analyzer also inserts `indent` and `outdent` tokens that represent regions of indented code [at certain points](./other-new-features/indentation.md). +The principle of optional braces is that any keyword that can be followed by `{` can also be followed by an indented block, without needing an intervening `:`. +(Allowing an optional `:` would be counterproductive since it would introduce several ways to do the same thing.) + +The lexical analyzer inserts `indent` and `outdent` tokens that represent regions of indented code [at certain points](./other-new-features/indentation.md). In the context-free productions below we use the notation `<<< ts >>>` to indicate a token sequence `ts` that is either enclosed in a pair of braces `{ ts }` or that constitutes an indented region `indent ts outdent`. Analogously, the