]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-110936: Reorder string literal definition in Lexical Analysis (GH-138063...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 16 Sep 2025 13:56:17 +0000 (15:56 +0200)
committerGitHub <noreply@github.com>
Tue, 16 Sep 2025 13:56:17 +0000 (16:56 +0300)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Doc/reference/lexical_analysis.rst

index 83db7646f1673f0a407d00a3040715c63fdf309e..f93666dcdc8f44289385114d506bc7dae7a84437 100644 (file)
@@ -628,10 +628,10 @@ to indicate that an ending quote ends the literal.
    STRING:          [`stringprefix`] (`stringcontent`)
    stringprefix:    <("r" | "u" | "b" | "br" | "rb"), case-insensitive>
    stringcontent:
-      | "'" ( !"'" `stringitem`)* "'"
-      | '"' ( !'"' `stringitem`)* '"'
       | "'''" ( !"'''" `longstringitem`)* "'''"
       | '"""' ( !'"""' `longstringitem`)* '"""'
+      | "'" ( !"'" `stringitem`)* "'"
+      | '"' ( !'"' `stringitem`)* '"'
    stringitem:      `stringchar` | `stringescapeseq`
    stringchar:      <any `source_character`, except backslash and newline>
    longstringitem:  `stringitem` | newline