Skip to content

Commit

Permalink
Spec: Update the list of tokens that can start/end statements.
Browse files Browse the repository at this point in the history
  • Loading branch information
sjrd committed Sep 28, 2023
1 parent acee11f commit 500ef4d
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 500ef4d

Please sign in to comment.