Skip to content

Commit

Permalink
Spec: Update the list of tokens that can start/end statements. (#18611)
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
bishabosha committed Sep 28, 2023
2 parents 892d734 + 500ef4d commit 5adef26
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions docs/_spec/01-lexical-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <xml-start>
_ ) ] }
this null true false return type given <xml-start>
_ ) ] } 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
Expand Down

0 comments on commit 5adef26

Please sign in to comment.