Commit 50b46c5
Merge #21
21: warn for keys/items/values/range r=ltratt a=nanjekyejoannah
I think I was over-thinking the solution with flags at synbol table generation. I found a simple check at the AST that checks correctness of values assigned to wanr for things like "True" and other keywords and used this check to warn for these calls.
This warns for `keys/values/items/range`:
Accurate when the statement is in an assignment:
`x = range(20)`
` y = d.keys()`
Co-authored-by: Joannah Nanjekye <[email protected]>3 files changed
+47
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
59 | 70 | | |
60 | 71 | | |
61 | 72 | | |
| |||
85 | 96 | | |
86 | 97 | | |
87 | 98 | | |
88 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
89 | 114 | | |
90 | 115 | | |
91 | 116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| 265 | + | |
265 | 266 | | |
266 | 267 | | |
267 | 268 | | |
268 | 269 | | |
269 | 270 | | |
270 | 271 | | |
271 | 272 | | |
| 273 | + | |
272 | 274 | | |
273 | 275 | | |
274 | 276 | | |
275 | 277 | | |
276 | 278 | | |
| 279 | + | |
277 | 280 | | |
278 | 281 | | |
279 | 282 | | |
280 | 283 | | |
281 | 284 | | |
| 285 | + | |
282 | 286 | | |
283 | 287 | | |
284 | 288 | | |
285 | 289 | | |
286 | 290 | | |
| 291 | + | |
287 | 292 | | |
288 | 293 | | |
289 | 294 | | |
290 | 295 | | |
291 | 296 | | |
292 | 297 | | |
| 298 | + | |
293 | 299 | | |
294 | 300 | | |
295 | 301 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| 149 | + | |
| 150 | + | |
149 | 151 | | |
150 | 152 | | |
151 | 153 | | |
| |||
157 | 159 | | |
158 | 160 | | |
159 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
160 | 175 | | |
161 | 176 | | |
162 | 177 | | |
| |||
0 commit comments