Repository navigation
Commit 0b9d75f
committed
Swift member calls: read each body's bindings once, and keep non-view leading-dot chains
Cast receivers: the lookup of `let x = y as? T` (and `if let` / `guard let`
/ `let x: T`) walked the enclosing function body once per member call on a
lowercase receiver, so extraction was quadratic in function size (an
8k-line generated function: 45 s). Each body is now read once into a
per-file table (CBMExtractCtx.swift_bindings, scratch arena), grouped by
name; a call is one hash probe and a binary search for the latest binding
before it. Same answers; the same function now indexes in 1.6 s.
Leading-dot chains: every multi-line `expr()\n .m()` became View.m, so
Combine, URLSession and other operator chains lost their edges. View.m is
now spelled only when the chain is a SwiftUI view: its root is a
constructor expression or a call of a capitalised (or qualified) type
name, or the chain applies a known view modifier. Other chains keep their
source text and bind as they did before the rewrite.
Signed-off-by: chidev <[email protected]>1 parent 4cac258 commit 0b9d75f
3 files changed
Lines changed: 594 additions & 59 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1122 | 1122 | | |
1123 | 1123 | | |
1124 | 1124 | | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
1125 | 1129 | | |
1126 | 1130 | | |
1127 | 1131 | | |
| |||
0 commit comments