switch (i) {
case 0, 1, 2:
break;
}
https://bugzilla.gnome.org/show_bug.cgi?id=614015
annotations/deprecated.vala \
annotations/description.vala \
annotations/noaccessormethod.test \
+ parser/switch-statement.vala \
$(NULL)
NON_NULL_TESTS = \
--- /dev/null
+void case_with_list () {
+ int i = 1;
+ switch (i) {
+ case 0, 1, 2:
+ break;
+ default:
+ assert_not_reached ();
+ }
+}
+
+void main () {
+ case_with_list ();
+}
do {
if (accept (TokenType.CASE)) {
section.add_label (new SwitchLabel (parse_expression (), get_src (begin)));
+ while (current () == TokenType.COMMA) {
+ expect (TokenType.COMMA);
+ section.add_label (new SwitchLabel (parse_expression (), get_src (begin)));
+ }
} else {
expect (TokenType.DEFAULT);
section.add_label (new SwitchLabel.with_default (get_src (begin)));