Skip to content

Commit ce65296

Browse files
authored
Documentation: principle of optional braces (#17045)
2 parents c610f18 + 137a684 commit ce65296

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/_docs/reference/syntax.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ semi ::= ‘;’ | nl {nl}
105105

106106
## Optional Braces
107107

108-
The lexical analyzer also inserts `indent` and `outdent` tokens that represent regions of indented code [at certain points](./other-new-features/indentation.md).
108+
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 `:`.
109+
(Allowing an optional `:` would be counterproductive since it would introduce several ways to do the same thing.)
110+
111+
The lexical analyzer inserts `indent` and `outdent` tokens that represent regions of indented code [at certain points](./other-new-features/indentation.md).
109112

110113
In the context-free productions below we use the notation `<<< ts >>>`
111114
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

0 commit comments

Comments
 (0)