On Wed, 1 Jul 2026 15:31:42 +1000
David Gibson
This was... a bit of a nightmare. It took way too long and went down a bunch of blind alleys. I'm not sure how much I like the final result: it's pleasingly terse in some cases, but in others it feels dangerously subtle, requiring a pretty careful understanding of the sequencing rules of C's &&, || and , operators.
That said, while I was at many points ready to pack it in and hack my around the problems limiting the parsing for destination remapping, I couldn't really think of feasible way to do that either. So, here we are.
v2: * Numerous minor tweaks based on Stefano's feedback. * The "minor issues" aren't actually minor - they're hard to solve in C, remain.
Minus the comment to 13/13, I would go ahead and apply this, even though I'm not entirely convinced about that parse_eoi() and also its friends that return true if they succeed, and false when they don't. I think that I'll get it wrong and that others might get it wrong. Same for that comma operator: there are a lot of ways to avoid it. And if we don't, you might remember how it all works, but I'd be surprised if I do or others do. Anyway, I don't have a much better proposal for the moment being so I'd say let's unblock this and I'll try to come up with some amendment later. -- Stefano