Mercurial > hg > octave-nkf
annotate libinterp/parse-tree/pt-jump.cc @ 19318:995df67fc912
Flip arrays - ND support for fliplr and flipud, and replace flipdim with flip.
* fliplr.m, flipud.m: add support for N-dimensional arrays by making use
of flip(). Added new tests for ND arrays and defaults.
* flipdim.m: deprecate in favour of new function flip() which has exactly the
same syntax and is part of Matlab since R2014a.
* flip.m: new function copied from flipdim. Added tests for ND arrays and
defaults.
* matrix.txi: replace flipdim DOCSTRINg with flip.
* rot90.m, rotdim.m, del2.m: replace flipdim() with flip()
* NEWS: note deprecation of flip(), new function flipdim(), and ND support
for flipud() and fliplr().
author | Carnë Draug <carandraug+dev@gmail.com> |
---|---|
date | Sun, 21 Sep 2014 18:49:08 +0100 |
parents | d63878346099 |
children | 4197fc428c7d |
rev | line source |
---|---|
2982 | 1 /* |
2 | |
17744
d63878346099
maint: Update copyright notices for release.
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
3 Copyright (C) 1996-2013 John W. Eaton |
2982 | 4 |
5 This file is part of Octave. | |
6 | |
7 Octave is free software; you can redistribute it and/or modify it | |
8 under the terms of the GNU General Public License as published by the | |
7016 | 9 Free Software Foundation; either version 3 of the License, or (at your |
10 option) any later version. | |
2982 | 11 |
12 Octave is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
19 <http://www.gnu.org/licenses/>. | |
2982 | 20 |
21 */ | |
22 | |
23 #ifdef HAVE_CONFIG_H | |
24 #include <config.h> | |
25 #endif | |
26 | |
27 #include "error.h" | |
3770 | 28 #include "oct-obj.h" |
29 #include "pt-bp.h" | |
2982 | 30 #include "pt-jump.h" |
31 #include "pt-walk.h" | |
32 | |
3770 | 33 class octave_value_list; |
34 | |
2982 | 35 // Break. |
36 | |
2985 | 37 // Nonzero means we're breaking out of a loop or function body. |
4207 | 38 int tree_break_command::breaking = 0; |
2985 | 39 |
5861 | 40 tree_command * |
7767
71f068b22fcc
scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
41 tree_break_command::dup (symbol_table::scope_id, |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
42 symbol_table::context_id) const |
5861 | 43 { |
44 return new tree_break_command (line (), column ()); | |
45 } | |
46 | |
2982 | 47 void |
4207 | 48 tree_break_command::accept (tree_walker& tw) |
2982 | 49 { |
4207 | 50 tw.visit_break_command (*this); |
2982 | 51 } |
52 | |
53 // Continue. | |
54 | |
2985 | 55 // Nonzero means we're jumping to the end of a loop. |
4207 | 56 int tree_continue_command::continuing = 0; |
2985 | 57 |
5861 | 58 tree_command * |
7767
71f068b22fcc
scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
59 tree_continue_command::dup (symbol_table::scope_id, |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
60 symbol_table::context_id) const |
5861 | 61 { |
62 return new tree_continue_command (line (), column ()); | |
63 } | |
64 | |
2982 | 65 void |
4207 | 66 tree_continue_command::accept (tree_walker& tw) |
2982 | 67 { |
4207 | 68 tw.visit_continue_command (*this); |
2982 | 69 } |
70 | |
71 // Return. | |
72 | |
5501 | 73 // Nonzero means we're returning from a function. |
4207 | 74 int tree_return_command::returning = 0; |
2985 | 75 |
5861 | 76 tree_command * |
7767
71f068b22fcc
scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
77 tree_return_command::dup (symbol_table::scope_id, |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
78 symbol_table::context_id) const |
5861 | 79 { |
80 return new tree_return_command (line (), column ()); | |
81 } | |
82 | |
2982 | 83 void |
4207 | 84 tree_return_command::accept (tree_walker& tw) |
2982 | 85 { |
4207 | 86 tw.visit_return_command (*this); |
2982 | 87 } |