Commit fb975d4
committed
fix: don't count '=' inside string literals when parsing parameters
PythonTranslator.inspect treated any line with more than one '=' as
unparseable, which incorrectly rejected parameter lines like
s = "a=b" where the second '=' is inside a string literal.
Count only top-level assignment operators using tokenize so the
existing PARAMETER_PATTERN regex (which already handles '=' in values
correctly) is given a chance to match.
Closes #8641 parent e4e4ddd commit fb975d4
2 files changed
Lines changed: 23 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
110 | 113 | | |
111 | 114 | | |
112 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
12 | 31 | | |
13 | 32 | | |
14 | 33 | | |
| |||
242 | 261 | | |
243 | 262 | | |
244 | 263 | | |
245 | | - | |
| 264 | + | |
246 | 265 | | |
247 | 266 | | |
248 | 267 | | |
| |||
0 commit comments