Commit af38843
committed
Fix: Reject list literals before || operator
Addresses feedback from @triska about [_]||Rs being incorrectly accepted.
The double bar operator should only work with double-quoted string literals,
not arbitrary list constructs. This commit:
- Removes Term::Cons validation case (was accepting any list)
- Only allows Term::CompleteString and Term::PartialString
- Simplifies push_binary_op to handle only string terms
- Removes unused replace_list_tail function
- Documents invalid cases in test file
Invalid cases now correctly rejected:
- [1,2,3]||K => syntax_error
- [_]||Rs => syntax_error
- K||[] => syntax_error (already worked)
- ("a")||[] => syntax_error (already worked)
All valid string cases still work:
- "abc"||K => [a,b,c|K]
- "a"||"b"||"c" => [a,b,c]
- ""||K => K1 parent ce86030 commit af38843
2 files changed
+17
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | 317 | | |
335 | 318 | | |
336 | 319 | | |
| |||
354 | 337 | | |
355 | 338 | | |
356 | 339 | | |
357 | | - | |
| 340 | + | |
358 | 341 | | |
| 342 | + | |
359 | 343 | | |
360 | 344 | | |
| 345 | + | |
361 | 346 | | |
362 | 347 | | |
363 | 348 | | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | 349 | | |
| 350 | + | |
371 | 351 | | |
372 | 352 | | |
373 | 353 | | |
| |||
1098 | 1078 | | |
1099 | 1079 | | |
1100 | 1080 | | |
1101 | | - | |
| 1081 | + | |
| 1082 | + | |
1102 | 1083 | | |
1103 | 1084 | | |
1104 | 1085 | | |
1105 | | - | |
1106 | | - | |
| 1086 | + | |
1107 | 1087 | | |
1108 | 1088 | | |
1109 | 1089 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
0 commit comments