47cffc5d2a
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. |
||
---|---|---|
.. | ||
mes | ||
mescc | ||
mescc.scm |