8000 Fix bug in tokenization of long format strings · geddski/python@be94905 · GitHub
[go: up one dir, main page]

Skip to content

Commit be94905

Browse files
committed
Fix bug in tokenization of long format strings
FIX: Fix a bug that caused `f"""` strings to be terminated at the first double quote in their content. Closes codemirror/dev#836
1 parent 89506ca commit be94905

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/python.grammar

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,8 @@ FormatReplacement { "{" (YieldExpression | commaSep<"*"? test>) FormatConversion
278278
longFormatString1_2 { !['\\{] | "\\" _ | "{{" | "'" longFormatString1_3 }
279279
longFormatString1_3 { !['\\{] | "\\" _ | "{{" }
280280

281-
longFormatString2Content { (!["\\{] | "\\" _ | "'" longFormatString2_2 | "{{")+ }
282-
longFormatString2_2 { !["\\{] | "\\" _ | "{{" | "'" longFormatString2_3 }
281+
longFormatString2Content { (!["\\{] | "\\" _ | '"' longFormatString2_2 | "{{")+ }
282+
longFormatString2_2 { !["\\{] | "\\" _ | "{{" | '"' longFormatString2_3 }
283283
longFormatString2_3 { !["\\{] | "\\" _ | "{{" }
284284

285285
@precedence { "{", formatString1Content, formatString2Content, longFormatString1Content, longFormatString2Content }

0 commit comments

Comments
 (0)
0