Commit 690e8bb
committed
autotranslate: address BR's agent-supported review (#958)
1. (correctness) REPL result-echo classifier is now Unicode-aware: the pattern
`(val|var)\s+\w+:.*=.*` gained a `(?U)` prefix so `\w` matches åäö. Without it,
`var räknaLäte: Int = 0` (SV) was NOT classified as output while its rename
`var callCount: Int = 0` (EN) was — breaking the SV/EN classification symmetry
that guarantees a mis-split can only skip, never false-flag. Verified: the SV
line now classifies as output; and the clean gate's phase-2 rose 12->14 ok as
two transcripts carrying such echo lines became self-contained instead of
self-skipping on a duplicate var.
2. Phase-1 regression entries now include the line number (file:line (env)), like
phase-2 — the regression list is the one a maintainer must act on.
3. Latex.ifswedishRanges warns on stderr when a range runs to EOF (unbalanced
\ifswedish, e.g. a stray one in a comment/verbatim) — but ONLY when the swallowed
region actually holds a code env / inline code (real consequence). Verified on the
corpus: 0 warnings, because the 10 EOF-unbalanced ranges are all top-level
scaffolding files (compendium.tex, lectures.tex, cover-*.tex) whose
\ifswedish/\ifPreSolution \fi lands across an \input boundary — matchFi
over-counts there but there is nothing to skip, so no noise.
4. ifswedishRanges returns a named tuple Seq[(start: Int, end: Int)]; call sites
(Translate + the gate) read r.start/r.end instead of positional (a, b).
5. Refreshed the gate's usage header (root is optional, --list documented).
6. Noted the per-file scaffold duplication across the three loops is deliberate
for a scratch tool (a shared HOF helper would add more indirection than it saves).
Item 7 (option-line stripping asymmetry) left as-is per the review — Code/CodeSmall
don't take optional args, so no change needed. Main project + gate both compile;
clean gate green (example 10/0, leak 293/0, phase-1 23/0, phase-2 14/0).1 parent 283ba80 commit 690e8bb
3 files changed
Lines changed: 34 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
149 | | - | |
| 148 | + | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
155 | 170 | | |
156 | 171 | | |
157 | 172 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
668 | 668 | | |
669 | 669 | | |
670 | 670 | | |
671 | | - | |
| 671 | + | |
672 | 672 | | |
673 | 673 | | |
674 | 674 | | |
| |||
680 | 680 | | |
681 | 681 | | |
682 | 682 | | |
683 | | - | |
| 683 | + | |
684 | 684 | | |
685 | 685 | | |
686 | 686 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
| |||
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
72 | 77 | | |
73 | 78 | | |
74 | 79 | | |
| |||
102 | 107 | | |
103 | 108 | | |
104 | 109 | | |
105 | | - | |
| 110 | + | |
106 | 111 | | |
107 | 112 | | |
108 | 113 | | |
| |||
112 | 117 | | |
113 | 118 | | |
114 | 119 | | |
115 | | - | |
116 | | - | |
| 120 | + | |
| 121 | + | |
117 | 122 | | |
118 | 123 | | |
119 | 124 | | |
| |||
144 | 149 | | |
145 | 150 | | |
146 | 151 | | |
147 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
148 | 156 | | |
149 | 157 | | |
150 | 158 | | |
| |||
160 | 168 | | |
161 | 169 | | |
162 | 170 | | |
163 | | - | |
| 171 | + | |
164 | 172 | | |
165 | 173 | | |
166 | 174 | | |
| |||
0 commit comments