[m-rev.] for review: better lookahead for switch detection

Zoltan Somogyi zoltan.somogyi at runbox.com
Fri Nov 14 18:49:58 AEDT 2025


This is the diff I was talking about on m-dev. For review by anyone.

The attached y.m shows the effect of the diff on an extract from
compiler/print_help.m. Without this diff, switch detection cannot handle it;
with the diff, it can handle it.

This diff does not implement either fix one, two or four discussed on m-dev.
Instead, it sidesteps the problem (the diff to message.m does this).

After this diff is committed, I intend to implement fix four. The attached z.m,
which is the simplified essence of the problem with the old message.m,
is intended to become the test case for that fix (under a more descriptive name,
of course). It will need to be extended to test the fix for Peter's example code
as well.

Zoltan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Log.sd
Type: chemical/x-mdl-sdfile
Size: 1008 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20251114/99e1f53a/attachment-0002.sd>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DIFF.sd
Type: chemical/x-mdl-sdfile
Size: 55809 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20251114/99e1f53a/attachment-0003.sd>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: y.m
Type: text/x-objcsrc
Size: 1516 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20251114/99e1f53a/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: z.m
Type: text/x-objcsrc
Size: 2248 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20251114/99e1f53a/attachment-0003.bin>


More information about the reviews mailing list