# HG changeset patch # User John W. Eaton # Date 1235410150 18000 # Node ID be7b30a24938c1b92e6036533996f9e98b58b4b7 # Parent c743891156104dc3be5df713c35edc3ab48855d8 line/column info for switch and if statements diff -r c74389115610 -r be7b30a24938 src/ChangeLog --- a/src/ChangeLog Mon Feb 23 12:25:45 2009 -0500 +++ b/src/ChangeLog Mon Feb 23 12:29:10 2009 -0500 @@ -1,5 +1,9 @@ 2009-02-23 John W. Eaton + * parse.y (finish_if_command): Also store line and column info for + if statement in first element of list. + (finish_switch_command): Likewise, for switch. + * input.cc (last_debugging_command): New static variable. (octave_gets): Set it here. Don't insert repeated debugging commands in the history list. diff -r c74389115610 -r be7b30a24938 src/parse.y --- a/src/parse.y Mon Feb 23 12:25:45 2009 -0500 +++ b/src/parse.y Mon Feb 23 12:29:10 2009 -0500 @@ -2296,6 +2296,17 @@ int l = if_tok->line (); int c = if_tok->column (); + if (list && ! list->empty ()) + { + tree_if_clause *elt = list->front (); + + if (elt) + { + elt->line (l); + elt->column (c); + } + } + retval = new tree_if_command (list, lc, tc, l, c); } @@ -2332,6 +2343,17 @@ int l = switch_tok->line (); int c = switch_tok->column (); + if (list && ! list->empty ()) + { + tree_switch_case *elt = list->front (); + + if (elt) + { + elt->line (l); + elt->column (c); + } + } + retval = new tree_switch_command (expr, list, lc, tc, l, c); }