Repository navigation
Commit 48af0f0
refactor(expressions): fold a bare boolean at the predicate level
The extra `boolean.copy()` is not needed. `handle_always_expression` already
did this fold; it was only attached to the whole expression, which is why
`(true) and foo = 1` worked and `true and foo = 1` did not -- infix_notation
returns the same Forward that a parenthesized sub-expression recurses through,
so the fold ran only when an operand happened to take that path.
Attach it to `predicate` instead so every operand folds. `literal` and
`literal_set` consume the boolean further in, so `foo = true` and
`foo in (true, false)` keep the raw `BooleanLiteral`. The top-level attachment
is now unreachable and is removed. Tests are unchanged.
Co-Authored-By: Claude Code <noreply@anthropic.com>1 parent c0768b1 commit 48af0f0
1 file changed
Lines changed: 18 additions & 35 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | 124 | | |
134 | 125 | | |
135 | 126 | | |
| |||
274 | 265 | | |
275 | 266 | | |
276 | 267 | | |
277 | | - | |
278 | | - | |
279 | | - | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
280 | 278 | | |
281 | 279 | | |
282 | 280 | | |
| |||
291 | 289 | | |
292 | 290 | | |
293 | 291 | | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
317 | 300 | | |
318 | 301 | | |
319 | 302 | | |
| |||
0 commit comments