From c4c61c6c8f344e736297a266dfbd52420c389d47 Mon Sep 17 00:00:00 2001 From: Rex Jaeschke Date: Mon, 2 Mar 2026 08:26:53 -0500 Subject: [PATCH 1/2] support new-lines in interpolations Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 21570b74-c6f5-4fc5-ab6d-7546918d6ddb Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 361b9a77-2b4c-45e6-969f-e6785c47f27e --- standard/expressions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/standard/expressions.md b/standard/expressions.md index 142e87ff6..13e1ce147 100644 --- a/standard/expressions.md +++ b/standard/expressions.md @@ -1485,8 +1485,8 @@ fragment Interpolated_Regular_String_Element fragment Interpolated_Regular_String_Character // Any character except " (U+0022), \\ (U+005C), - // { (U+007B), } (U+007D), and New_Line_Character. - : ~["\\{}\u000D\u000A\u0085\u2028\u2029] + // { (U+007B), and } (U+007D). + : ~["\\{}] ; // interpolated verbatim string expressions From bfd267835a118baffdaa055caf5d280de55c6ab1 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Tue, 17 Nov 2026 13:08:40 -0500 Subject: [PATCH 2/2] Update allowed characters in interpolated expressions Add additional Unicode characters disallowed or allowed in interpolated expressions in an interpolated string expression. --- standard/expressions.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/standard/expressions.md b/standard/expressions.md index 13e1ce147..3c50d61b8 100644 --- a/standard/expressions.md +++ b/standard/expressions.md @@ -1485,8 +1485,8 @@ fragment Interpolated_Regular_String_Element fragment Interpolated_Regular_String_Character // Any character except " (U+0022), \\ (U+005C), - // { (U+007B), and } (U+007D). - : ~["\\{}] + // { (U+007B), } (U+007D), and New_Line_Character. + : ~["\\{}\u000D\u000A\u0085\u2028\u2029] ; // interpolated verbatim string expressions @@ -1552,6 +1552,8 @@ Six of the lexical rules defined above are *context sensitive* as follows: | *Interpolated_Regular_String_End* | Only recognised after an *Interpolated_Regular_String_Start* and only if any intervening tokens are either *Interpolated_Regular_String_Mid*s or tokens that can be part of *regular_interpolation*s, including tokens for any *interpolated_regular_string_expression*s contained within such interpolations. | | *Interpolated_Verbatim_String_Mid* *Verbatim_Interpolation_Format* *Interpolated_Verbatim_String_End* | Recognition of these three rules follows that of the corresponding rules above with each mentioned *regular* grammar rule replaced by the corresponding *verbatim* one. | +Expressions within a *regular_interpolation* follow the ordinary lexical rules ([ยง6.3](lexical-structure.md#63-lexical-analysis)), so line terminators, white space, and comments are permitted as in other expressions. + > *Note*: The above rules are context sensitive as their definitions overlap with those of other tokens in the language. *end note*