mes/module
Ekaitz Zarraga 47cffc5d2a mescc: Fix switch statements' fallthrough
Flattens case structures as nyacc is giving consecutive cases as a
nested block like:

    (case testA
      (case testB
        (case testC BODY)))

We convert to:

    ((case testA (expr-stmt))
     (case testB (expr-stmt))
     (case testC BODY))

And then treat them as independent cases. For the fallthrough we just
add a jump to each case's body right before its clause (each of the case
blocks is responsible of adding its own jump to its body):

        // This doesn't have it because it's the first
    CASE1:
        testA
    CASE1_BODY:

        goto CASE2_BODY
    CASE2:
        testB
    CASE2_BODY:

        goto CASE3_BODY
    CASE3:
        testB
    CASE3_BODY:

This enables complex fallthrough schemes comparing to what was done
before.

* module/mescc/compile.scm (ast->info)[switch]{flatten-cases}: New
variable.
(ast->info)[switch]{statements}: Use flatten-cases on it.
(switch->expr): Remove unneeded matchers and add jumps to body.
* build-aux/check-mescc.sh(xfail-tests): Remove
lib/tests/scaffold/66-local-char-array.c.
2023-11-05 09:45:31 +01:00
..
mes mes: Add %program to mes-compatibility for Guile. 2023-08-24 15:28:35 +02:00
mescc mescc: Fix switch statements' fallthrough 2023-11-05 09:45:31 +01:00
mescc.scm build: Drop support for mescc-tools 0.5.2. 2023-05-03 14:52:25 +02:00