From 859a60276b7612d1c87f829c736bdcb69cfbb324 Mon Sep 17 00:00:00 2001 From: Carl Gay Date: Fri, 15 Sep 2023 23:25:10 +0000 Subject: [PATCH] Implement DEP 12, string literals supporting Rectangle Rule See https://opendylan.org/proposals/dep-0012-string-literals.html#the-rectangle-rule for details. --- .../source/language-extensions/string-literals.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/documentation/library-reference/source/language-extensions/string-literals.rst b/documentation/library-reference/source/language-extensions/string-literals.rst index 8e8cfbbae..e23716c84 100644 --- a/documentation/library-reference/source/language-extensions/string-literals.rst +++ b/documentation/library-reference/source/language-extensions/string-literals.rst @@ -9,11 +9,15 @@ processing ("raw" strings) and multi-line strings. Briefly, #. Multi-line strings begin with three double-quote characters: ``"""`` #. End-of-line sequences in multi-line strings are always parsed as a single - Newline (``\\n``) character, regardless of source file line endings or the + Newline (``\n``) character, regardless of source file line endings or the conventions of the operating system. #. Any string, whether delimited by ``"`` or ``"""`` may be prefixed with ``#r`` or ``#R`` to disable escape sequence processing. +#. Any leading whitespace that *matches the whitespace preceding the end + ``"""`` delimiter* is removed, allowing multi-line strings to be formatted + nicely in source code. + See `DEP 12 `_ for details.