You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Add missing soft modifiers
2. Port changes from multiple type parameter sections to reference.
Now that multiple type parameter sections are merged, this is the
official syntax. This also covers extension method declarations.
Fixes#19667Fixes#19668
[Cherry-picked e06b831]
Copy file name to clipboardExpand all lines: docs/_docs/internals/syntax.md
+29-13
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,8 @@ productions map to AST nodes.
20
20
The following description of Scala tokens uses literal characters `‘c’` when
21
21
referring to the ASCII fragment `\u0000` – `\u007F`.
22
22
23
+
Informal descriptions are typeset as `“some comment”`.
24
+
23
25
## Lexical Syntax
24
26
25
27
The lexical syntax of Scala is given by the following grammar in EBNF form:
@@ -99,7 +101,10 @@ semi ::= ‘;’ | nl {nl}
99
101
100
102
## Optional Braces
101
103
102
-
The lexical analyzer also inserts `indent` and `outdent` tokens that represent regions of indented code [at certain points](../reference/other-new-features/indentation.md)
104
+
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 `:`.
105
+
(Allowing an optional `:` would be counterproductive since it would introduce several ways to do the same thing.)
106
+
107
+
The lexical analyzer inserts `indent` and `outdent` tokens that represent regions of indented code [at certain points](./other-new-features/indentation.md).
103
108
104
109
In the context-free productions below we use the notation `<<< ts >>>`
105
110
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