From d874f797193e2a581d7a490ce9ac55b707d6bb51 Mon Sep 17 00:00:00 2001 From: danarmak Date: Mon, 31 Oct 2022 16:39:09 +0200 Subject: [PATCH] Document: don't allow characters with unicode property Bidi_Class in source files Update documentation with changes made in scala#10017 --- spec/01-lexical-syntax.md | 5 +++++ spec/13-syntax-summary.md | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/spec/01-lexical-syntax.md b/spec/01-lexical-syntax.md index 921384b40e20..36f6daaa989d 100644 --- a/spec/01-lexical-syntax.md +++ b/spec/01-lexical-syntax.md @@ -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_. diff --git a/spec/13-syntax-summary.md b/spec/13-syntax-summary.md index 6ece538e2ff1..65eb47049519 100644 --- a/spec/13-syntax-summary.md +++ b/spec/13-syntax-summary.md @@ -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: