mescc: Tinycc support: multiple statements in default case.

* module/language/c99/compiler.mes (clause->info): Support multiple
  statements in default case.
This commit is contained in:
Jan Nieuwenhuizen 2017-07-23 23:04:00 +02:00
parent a7a3de05f6
commit 4ec2532ad5
2 changed files with 3 additions and 0 deletions

View file

@ -1295,6 +1295,8 @@
(loop statement (append cases (list (test->text test))) clause))
((default ,statement)
(loop statement cases clause))
((default . ,statements)
(loop `(compd-stmt (block-item-list ,@statements)) cases clause))
((compd-stmt (block-item-list))
(loop '() cases clause))
((compd-stmt (block-item-list . ,elements))

View file

@ -51,6 +51,7 @@ swits (int c)
x = 1;
break;
default:
x = 2;
x = 2;
break;
}