From 9661be7eea50a0bf6052b4aa3f07bb4055d2c2f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Doeraene?= Date: Thu, 28 Sep 2023 16:24:28 +0200 Subject: [PATCH] Spec: Update the list of tokens that can start/end statements. [Cherry-picked 500ef4d4972c1c561c50d97a1767c266696232f1] --- docs/_spec/01-lexical-syntax.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/_spec/01-lexical-syntax.md b/docs/_spec/01-lexical-syntax.md index 9f7c3ba76a24..7dfcea87bd2d 100644 --- a/docs/_spec/01-lexical-syntax.md +++ b/docs/_spec/01-lexical-syntax.md @@ -170,20 +170,19 @@ A newline in a Scala source text is treated as the special token “nl” if the The tokens that can terminate a statement are: literals, identifiers and the following delimiters and reserved words: ``` -this null true false return type -_ ) ] } +this null true false return type given +_ ) ] } outdent ``` The tokens that can begin a statement are all Scala tokens _except_ the following delimiters and reserved words: ``` -catch else extends finally forSome match with yield -, . ; : = => <- <: <% >: # [ ) ] } +catch do else extends finally forSome macro +match then with yield +, . ; : = => <- <: <% >: # =>> ?=> +) ] } outdent ``` -A `case` token can begin a statement only if followed by a -`class` or `object` token. - A _leading infix operator_ is a symbolic identifier such as `+`, or `approx_==`, or an identifier in backticks that: - starts a new line, and