Mercurial > octave
annotate libinterp/corefcn/gripes.cc @ 21101:2e8aea678f2a
Deprecate gripe_XXX functions.
* NEWS: Announce deprecation.
* gripes.h: Add OCTAVE_DEPRECATED attribute to all functions.
Add FIXME note about removal in 4.6.
* gripes.cc: Add FIXME note about removal in 4.6.
* lo-array-gripes.h: Add OCTAVE_DEPRECATED attribute to all functions.
Add FIXME note about removal in 4.6.
* lo-array-gripes.cc: Add FIXME note about removal in 4.6.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 18 Jan 2016 19:23:56 -0800 |
parents | 4484384a2959 |
children | 95da3bc8a281 |
rev | line source |
---|---|
1 | 1 /* |
2 | |
19697
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
19030
diff
changeset
|
3 Copyright (C) 1993-2015 John W. Eaton |
1 | 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. | |
1 | 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/>. | |
1 | 20 |
21 */ | |
22 | |
21101 | 23 // FIXME: All gripe_XXX functions deprecated in 4.2. Remove file in 4.6 |
24 | |
240 | 25 #ifdef HAVE_CONFIG_H |
1192 | 26 #include <config.h> |
1 | 27 #endif |
28 | |
5755 | 29 #include "defun.h" |
1352 | 30 #include "error.h" |
1 | 31 #include "gripes.h" |
20940
48b2ad5ee801
maint: Rename oct-obj.[cc|h] to ovl.[cc|h] for clarity.
Rik <rik@octave.org>
parents:
20785
diff
changeset
|
32 #include "ovl.h" |
5755 | 33 #include "utils.h" |
34 | |
21026 | 35 //////////////////////////////////////////////////////////////////////////////// |
36 // Alphabetized list of gripes. | |
37 //////////////////////////////////////////////////////////////////////////////// | |
38 | |
1 | 39 void |
21026 | 40 gripe_2_or_3_dim_plot (void) |
41 { | |
42 error ("plot: can only plot in 2 or 3 dimensions"); | |
43 } | |
44 | |
45 void | |
46 gripe_data_conversion (const char *from, const char *to) | |
47 { | |
48 error ("unable to convert from %s to %s format", from, to); | |
49 } | |
50 | |
51 void | |
52 gripe_data_file_in_path (const std::string& fcn, const std::string& file) | |
2078 | 53 { |
21026 | 54 warning_with_id ("Octave:data-file-in-path", |
55 "%s: '%s' found by searching load path", | |
56 fcn.c_str (), file.c_str ()); | |
57 } | |
58 | |
59 void | |
21081
397f6ee4a35d
Extend msg from gripe_disabled_feature to handle case where libraries not available.
Rik <rik@octave.org>
parents:
21026
diff
changeset
|
60 gripe_disabled_feature (const std::string& fcn, const std::string& feature, |
21026 | 61 const std::string& pkg /*="Octave"*/) |
62 { | |
21081
397f6ee4a35d
Extend msg from gripe_disabled_feature to handle case where libraries not available.
Rik <rik@octave.org>
parents:
21026
diff
changeset
|
63 error ("%s: support for %s was unavailable or disabled when %s was built", |
397f6ee4a35d
Extend msg from gripe_disabled_feature to handle case where libraries not available.
Rik <rik@octave.org>
parents:
21026
diff
changeset
|
64 fcn.c_str (), feature.c_str (), pkg.c_str ()); |
21026 | 65 } |
66 | |
67 void | |
68 gripe_divide_by_zero (void) | |
69 { | |
70 warning_with_id ("Octave:divide-by-zero", "division by zero"); | |
71 } | |
72 | |
73 void | |
74 gripe_empty_arg (const char *name, bool is_error) | |
75 { | |
76 if (is_error) | |
77 error ("%s: empty matrix is invalid as an argument", name); | |
78 else | |
79 warning ("%s: argument is empty matrix", name); | |
2078 | 80 } |
81 | |
82 void | |
21026 | 83 gripe_implicit_conversion (const char *id, const char *from, const char *to) |
84 { | |
85 warning_with_id (id, "implicit conversion from %s to %s", from, to); | |
86 } | |
87 | |
88 void | |
89 gripe_implicit_conversion (const std::string& id, | |
90 const std::string& from, const std::string& to) | |
6890 | 91 { |
21026 | 92 warning_with_id (id.c_str (), |
93 "implicit conversion from %s to %s", | |
94 from.c_str (), to.c_str ()); | |
95 } | |
96 | |
97 void | |
98 gripe_indexed_cs_list (void) | |
99 { | |
100 error ("a cs-list cannot be further indexed"); | |
6890 | 101 } |
102 | |
103 void | |
21026 | 104 gripe_invalid_conversion (const std::string& from, const std::string& to) |
1 | 105 { |
21026 | 106 error ("invalid conversion from %s to %s", from.c_str (), to.c_str ()); |
107 } | |
108 | |
109 void | |
110 gripe_invalid_inquiry_subscript (void) | |
111 { | |
112 error ("invalid dimension inquiry of a non-existent value"); | |
1 | 113 } |
114 | |
115 void | |
21026 | 116 gripe_invalid_value_specified (const char *name) |
117 { | |
118 warning ("invalid value specified for '%s'", name); | |
119 } | |
120 | |
121 void | |
122 gripe_logical_conversion (void) | |
1 | 123 { |
21026 | 124 warning_with_id ("Octave:logical-conversion", |
125 "value not equal to 1 or 0 converted to logical 1"); | |
126 } | |
127 | |
128 void | |
129 gripe_nonbraced_cs_list_assignment (void) | |
130 { | |
131 error ("invalid assignment to cs-list outside multiple assignment"); | |
1 | 132 } |
133 | |
134 void | |
135 gripe_nonconformant (void) | |
136 { | |
137 error ("nonconformant matrices"); | |
138 } | |
139 | |
140 void | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
141 gripe_nonconformant (octave_idx_type r1, octave_idx_type c1, |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
142 octave_idx_type r2, octave_idx_type c2) |
143 | 143 { |
144 error ("nonconformant matrices (op1 is %dx%d, op2 is %dx%d)", | |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
145 r1, c1, r2, c2); |
143 | 146 } |
147 | |
148 void | |
21026 | 149 gripe_not_implemented (const char *fcn) |
150 { | |
151 error ("%s: not implemented", fcn); | |
152 } | |
153 | |
21082 | 154 // FIXME: Deprecated in 4.2, remove in 4.6 |
21026 | 155 void |
156 gripe_not_supported (const char *fcn) | |
1 | 157 { |
21026 | 158 error ("%s: not supported on this system", fcn); |
159 } | |
160 | |
161 void | |
162 gripe_range_invalid (void) | |
163 { | |
164 error ("range constant used in invalid context"); | |
1 | 165 } |
166 | |
167 void | |
168 gripe_square_matrix_required (const char *name) | |
169 { | |
170 error ("%s: argument must be a square matrix", name); | |
171 } | |
172 | |
173 void | |
21026 | 174 gripe_string_invalid (void) |
175 { | |
176 error ("std::string constant used in invalid context"); | |
177 } | |
178 | |
179 void | |
180 gripe_unrecognized_data_fmt (const char *warn_for) | |
181 { | |
182 error ("%s: unrecognized data format requested", warn_for); | |
183 } | |
184 | |
185 void | |
186 gripe_unrecognized_float_fmt (void) | |
187 { | |
188 error ("unrecognized floating point format requested"); | |
189 } | |
190 | |
191 void | |
192 gripe_user_returned_invalid (const char *name) | |
193 { | |
194 error ("%s: user-supplied function returned invalid value", name); | |
195 } | |
196 | |
197 void | |
1 | 198 gripe_user_supplied_eval (const char *name) |
199 { | |
20756
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
200 octave_execution_exception e; |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
201 |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
202 gripe_user_supplied_eval (e, name); |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
203 } |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
204 |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
205 void |
20785
b6f2909e7f94
always throw exception after debugging with debug_on_error
John W. Eaton <jwe@octave.org>
parents:
20756
diff
changeset
|
206 gripe_user_supplied_eval (octave_execution_exception& e, |
20756
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
207 const char *name) |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
208 { |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
209 error (e, "%s: evaluation of user-supplied function failed", name); |
1 | 210 } |
211 | |
212 void | |
21026 | 213 gripe_warn_complex_cmp (void) |
777 | 214 { |
21026 | 215 warning_with_id ("Octave:language-extension", |
216 "comparing complex numbers is not supported in Matlab"); | |
777 | 217 } |
218 | |
219 void | |
5602 | 220 gripe_wrong_type_arg (const char *name, const char *s, bool is_error) |
2668 | 221 { |
20756
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
222 octave_execution_exception e; |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
223 |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
224 gripe_wrong_type_arg (e, name, s, is_error); |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
225 } |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
226 |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
227 void |
20785
b6f2909e7f94
always throw exception after debugging with debug_on_error
John W. Eaton <jwe@octave.org>
parents:
20756
diff
changeset
|
228 gripe_wrong_type_arg (octave_execution_exception& e, |
20756
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
229 const char *name, const char *s, bool is_error) |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
230 { |
2799 | 231 if (is_error) |
20756
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
232 error (e, "%s: wrong type argument '%s'", name, s); |
2799 | 233 else |
15466
d174210ce1ec
use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
234 warning ("%s: wrong type argument '%s'", name, s); |
5602 | 235 } |
236 | |
237 void | |
238 gripe_wrong_type_arg (const char *name, const std::string& s, bool is_error) | |
239 { | |
20756
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
240 octave_execution_exception e; |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
241 |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
242 gripe_wrong_type_arg (e, name, s.c_str (), is_error); |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
243 } |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
244 |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
245 void |
20785
b6f2909e7f94
always throw exception after debugging with debug_on_error
John W. Eaton <jwe@octave.org>
parents:
20756
diff
changeset
|
246 gripe_wrong_type_arg (octave_execution_exception& e, |
20756
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
247 const char *name, const std::string& s, bool is_error) |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
248 { |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
249 gripe_wrong_type_arg (e, name, s.c_str (), is_error); |
2668 | 250 } |
251 | |
252 void | |
2799 | 253 gripe_wrong_type_arg (const char *name, const octave_value& tc, |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
254 bool is_error) |
777 | 255 { |
20756
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
256 octave_execution_exception e; |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
257 |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
258 gripe_wrong_type_arg (e, name, tc, is_error); |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
259 } |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
260 |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
261 void |
20785
b6f2909e7f94
always throw exception after debugging with debug_on_error
John W. Eaton <jwe@octave.org>
parents:
20756
diff
changeset
|
262 gripe_wrong_type_arg (octave_execution_exception& e, |
20756
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
263 const char *name, const octave_value& tc, |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
264 bool is_error) |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
265 { |
3523 | 266 std::string type = tc.type_name (); |
2799 | 267 |
20756
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
268 gripe_wrong_type_arg (e, name, type, is_error); |
777 | 269 } |
270 | |
271 void | |
7352 | 272 gripe_wrong_type_arg (const std::string& name, const octave_value& tc, |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
273 bool is_error) |
7352 | 274 { |
20756
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
275 octave_execution_exception e; |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
276 |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
277 gripe_wrong_type_arg (e, name, tc, is_error); |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
278 } |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
279 |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
280 void |
20785
b6f2909e7f94
always throw exception after debugging with debug_on_error
John W. Eaton <jwe@octave.org>
parents:
20756
diff
changeset
|
281 gripe_wrong_type_arg (octave_execution_exception& e, |
20756
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
282 const std::string& name, const octave_value& tc, |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
283 bool is_error) |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
284 { |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
285 gripe_wrong_type_arg (e, name.c_str (), tc, is_error); |
7352 | 286 } |
287 | |
288 void | |
20700
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
289 gripe_wrong_type_arg (const char *s, bool is_error) |
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
290 { |
20756
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
291 octave_execution_exception e; |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
292 |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
293 gripe_wrong_type_arg (e, s, is_error); |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
294 } |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
295 |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
296 void |
20785
b6f2909e7f94
always throw exception after debugging with debug_on_error
John W. Eaton <jwe@octave.org>
parents:
20756
diff
changeset
|
297 gripe_wrong_type_arg (octave_execution_exception& e, |
20756
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
298 const char *s, bool is_error) |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
299 { |
20700
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
300 if (is_error) |
20756
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
301 error (e, "wrong type argument '%s'", s); |
20700
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
302 else |
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
303 warning ("wrong type argument '%s'", s); |
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
304 } |
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
305 |
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
306 void |
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
307 gripe_wrong_type_arg (const std::string& s, bool is_error) |
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
308 { |
20756
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
309 octave_execution_exception e; |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
310 |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
311 gripe_wrong_type_arg (e, s, is_error); |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
312 } |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
313 |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
314 void |
20785
b6f2909e7f94
always throw exception after debugging with debug_on_error
John W. Eaton <jwe@octave.org>
parents:
20756
diff
changeset
|
315 gripe_wrong_type_arg (octave_execution_exception& e, |
20756
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
316 const std::string& s, bool is_error) |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
317 { |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
318 gripe_wrong_type_arg (e, s.c_str (), is_error); |
20700
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
319 } |
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
320 |
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
321 void |
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
322 gripe_wrong_type_arg (const octave_value& tc, bool is_error) |
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
323 { |
20756
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
324 octave_execution_exception e; |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
325 |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
326 gripe_wrong_type_arg (e, tc, is_error); |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
327 } |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
328 |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
329 void |
20785
b6f2909e7f94
always throw exception after debugging with debug_on_error
John W. Eaton <jwe@octave.org>
parents:
20756
diff
changeset
|
330 gripe_wrong_type_arg (octave_execution_exception& e, |
20756
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
331 const octave_value& tc, bool is_error) |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
332 { |
20700
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
333 std::string type = tc.type_name (); |
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
334 |
20756
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
335 gripe_wrong_type_arg (e, type, is_error); |
20700
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
336 } |
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
337 |
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
338 void |
2086 | 339 gripe_wrong_type_arg_for_binary_op (const octave_value& op) |
777 | 340 { |
3523 | 341 std::string type = op.type_name (); |
15466
d174210ce1ec
use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
342 error ("invalid operand '%s' for binary operator", type.c_str ()); |
2374 | 343 } |
344 | |
345 void | |
21026 | 346 gripe_wrong_type_arg_for_unary_op (const octave_value& op) |
4452 | 347 { |
21026 | 348 std::string type = op.type_name (); |
349 error ("invalid operand '%s' for unary operator", type.c_str ()); | |
8579
7e0f36dfefbe
implement octave_value_list using Array
Jaroslav Hajek <highegg@gmail.com>
parents:
8039
diff
changeset
|
350 } |
7e0f36dfefbe
implement octave_value_list using Array
Jaroslav Hajek <highegg@gmail.com>
parents:
8039
diff
changeset
|
351 |