]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-110936: Reorder string literal definition in Lexical Analysis (GH-138063)
authorStan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Tue, 2 Sep 2025 11:48:26 +0000 (12:48 +0100)
committerGitHub <noreply@github.com>
Tue, 2 Sep 2025 11:48:26 +0000 (13:48 +0200)
Doc/reference/lexical_analysis.rst

index e320eedfa67a27db9d58b424419e4c3881d79478..6338c181813bbecfd99c074e45faaad7d25cbedd 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