Skip to content

Commit

Permalink
Merge pull request #10197 from danarmak/correct-string-literal-docs
Browse files Browse the repository at this point in the history
Document: don't allow characters with unicode property Bidi_Class in source files
  • Loading branch information
lrytz committed Nov 4, 2022
2 parents 6e2b609 + d874f79 commit 6190d9a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions spec/01-lexical-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ chapter: 1

Scala source code consists of Unicode text.

The nine [Bidirectional explicit formatting](https://www.unicode.org/reports/tr9/#Bidirectional_Character_Types)
characters `\u202a - \u202e` and `\u2066 - \u2069` (inclusive) are forbidden
from appearing in source files. Note that they can be represented using
unicode escapes in string and character literals.

The program text is tokenized as described in this chapter.
See the last section for special support for XML literals,
which are parsed in _XML mode_.
Expand Down
5 changes: 5 additions & 0 deletions spec/13-syntax-summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ chapter: 13

The following descriptions of Scala tokens uses literal characters `‘c’` when referring to the ASCII fragment `\u0000``\u007F`.

The nine [Bidirectional explicit formatting](https://www.unicode.org/reports/tr9/#Bidirectional_Character_Types)
characters `\u202a - \u202e` and `\u2066 - \u2069` (inclusive) are forbidden
from appearing in source files. Note that they can be represented using
unicode escapes in string and character literals.

## Lexical Syntax

The lexical syntax of Scala is given by the following grammar in EBNF form:
Expand Down

0 comments on commit 6190d9a

Please sign in to comment.