Commit 0430236
authored
Among other things, `get_expr_length` currently supports StrExpr,
BytesExpr, and string-type Final values.
`constant_fold_expr` already has the code to parse values from all of
these, so we can use it to deduplicate code in `get_expr_length`.
It's able to parse a few more Expressions than our existing
implementation, not that any of these are particularly relevant at the
moment, and allows get_expr_length to automatically benefit from more
relevant future constant-folding enhancements.
1 parent dabcce9 commit 0430236
2 files changed
+52
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
| |||
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
27 | | - | |
28 | 26 | | |
29 | 27 | | |
30 | | - | |
31 | 28 | | |
32 | 29 | | |
33 | 30 | | |
| |||
68 | 65 | | |
69 | 66 | | |
70 | 67 | | |
| 68 | + | |
71 | 69 | | |
72 | 70 | | |
73 | 71 | | |
| |||
1225 | 1223 | | |
1226 | 1224 | | |
1227 | 1225 | | |
1228 | | - | |
1229 | | - | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
1230 | 1229 | | |
1231 | 1230 | | |
1232 | 1231 | | |
| |||
1236 | 1235 | | |
1237 | 1236 | | |
1238 | 1237 | | |
1239 | | - | |
1240 | | - | |
1241 | | - | |
1242 | | - | |
1243 | | - | |
1244 | | - | |
1245 | | - | |
1246 | | - | |
1247 | 1238 | | |
1248 | 1239 | | |
1249 | 1240 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
434 | 434 | | |
435 | 435 | | |
436 | 436 | | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
437 | 485 | | |
438 | 486 | | |
439 | 487 | | |
| |||
0 commit comments