accept otherwise clause in switch statement without preceding case statements
author |
John W. Eaton <jwe@octave.org> |
date |
Tue, 07 Dec 2010 12:57:55 -0500 |
parents |
b7ff4a51ea88 |
children |
d7ea780b036f |
files |
src/ChangeLog src/oct-parse.yy |
diffstat |
2 files changed, 7 insertions(+), 0 deletions(-)
[+]
|
line diff
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2010-12-07 John W. Eaton <jwe@octave.org>
+
+ * oct-parse.yy (case_list): Also accept default_case by itself.
+ Bug #31793.
+
2010-12-01 John W. Eaton <jwe@octave.org>
* pt-pr-code.cc (tree_print_code::visit_octave_user_function_trailer):
--- a/src/oct-parse.yy
+++ b/src/oct-parse.yy
@@ -1101,6 +1101,8 @@
case_list : // empty
{ $$ = new tree_switch_case_list (); }
+ | default_case
+ { $$ = new tree_switch_case_list ($1); }
| case_list1
{ $$ = $1; }
| case_list1 default_case