Repository navigation
Commit b194411
authored
Warn on invalid octal escapes and parse-fail strings (RustPython#8686)
* Warn on invalid octal escapes and parse-fail strings
Treat three-digit octal values above 0o377 as invalid escapes and
scan quoted literals even when parse fails, so SyntaxWarning is
emitted before a later SyntaxError. Keep warning and SyntaxError
text on InvalidEscape.
Enable the remaining test_string_literals invalid-escape cases.
Assisted-by: Grok:4.6
* Remove expectedFailure from passing test_codeop cases
test_invalid_warning and test_raw_raises_error now emit
SyntaxWarning on parse-fail invalid escapes.
Assisted-by: Grok:4.6
* Scan unparsed strings with token-boundary prefixes
Require a complete prefix at an identifier boundary, and walk
f-string interpolations separately after a parse failure.
Assisted-by: Grok:4.61 parent 7d0a6a7 commit b194411
3 files changed
Lines changed: 492 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
351 | | - | |
352 | 351 | | |
353 | 352 | | |
354 | 353 | | |
| |||
358 | 357 | | |
359 | 358 | | |
360 | 359 | | |
361 | | - | |
362 | 360 | | |
363 | 361 | | |
364 | 362 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
109 | 108 | | |
110 | 109 | | |
111 | 110 | | |
| |||
147 | 146 | | |
148 | 147 | | |
149 | 148 | | |
150 | | - | |
151 | 149 | | |
152 | 150 | | |
153 | 151 | | |
| |||
253 | 251 | | |
254 | 252 | | |
255 | 253 | | |
256 | | - | |
257 | 254 | | |
258 | 255 | | |
259 | 256 | | |
| |||
0 commit comments