Mercurial > octave
comparison libinterp/operators/op-class.cc @ 20833:9c4c87679985
restructure calls to error
* op-bm-bm.cc, op-cell.cc, op-class.cc, op-cm-cm.cc, op-fcm-fcm.cc,
op-fm-fm.cc, op-m-m.cc, op-str-str.cc, op-struct.cc:
Restructure calls to error to avoid excess indentation.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 09 Dec 2015 14:32:04 -0500 |
parents | 4197fc428c7d |
children | 48b2ad5ee801 |
comparison
equal
deleted
inserted
replaced
20832:3951d420556c | 20833:9c4c87679985 |
---|---|
46 \ | 46 \ |
47 std::string class_name = a.class_name (); \ | 47 std::string class_name = a.class_name (); \ |
48 \ | 48 \ |
49 octave_value meth = symbol_table::find_method (#name, class_name); \ | 49 octave_value meth = symbol_table::find_method (#name, class_name); \ |
50 \ | 50 \ |
51 if (meth.is_defined ()) \ | 51 if (meth.is_undefined ()) \ |
52 { \ | 52 error ("%s method not defined for %s class", #name, \ |
53 octave_value_list args; \ | 53 class_name.c_str ()); \ |
54 \ | 54 \ |
55 args(0) = a; \ | 55 octave_value_list args; \ |
56 \ | 56 \ |
57 octave_value_list tmp = feval (meth.function_value (), args, 1); \ | 57 args(0) = a; \ |
58 \ | 58 \ |
59 if (tmp.length () > 0) \ | 59 octave_value_list tmp = feval (meth.function_value (), args, 1); \ |
60 retval = tmp(0); \ | 60 \ |
61 } \ | 61 if (tmp.length () > 0) \ |
62 else \ | 62 retval = tmp(0); \ |
63 error ("%s method not defined for %s class", \ | |
64 #name, class_name.c_str ()); \ | |
65 \ | 63 \ |
66 return retval; \ | 64 return retval; \ |
67 } | 65 } |
68 | 66 |
69 DEF_CLASS_UNOP (not) | 67 DEF_CLASS_UNOP (not) |
83 std::string dispatch_type \ | 81 std::string dispatch_type \ |
84 = a1.is_object () ? a1.class_name () : a2.class_name (); \ | 82 = a1.is_object () ? a1.class_name () : a2.class_name (); \ |
85 \ | 83 \ |
86 octave_value meth = symbol_table::find_method (#name, dispatch_type); \ | 84 octave_value meth = symbol_table::find_method (#name, dispatch_type); \ |
87 \ | 85 \ |
88 if (meth.is_defined ()) \ | 86 if (meth.is_undefined ()) \ |
89 { \ | 87 error ("%s method not defined for %s class", #name, \ |
90 octave_value_list args; \ | 88 dispatch_type.c_str ()); \ |
91 \ | 89 \ |
92 args(1) = a2; \ | 90 octave_value_list args; \ |
93 args(0) = a1; \ | |
94 \ | 91 \ |
95 octave_value_list tmp = feval (meth.function_value (), args, 1); \ | 92 args(1) = a2; \ |
93 args(0) = a1; \ | |
96 \ | 94 \ |
97 if (tmp.length () > 0) \ | 95 octave_value_list tmp = feval (meth.function_value (), args, 1); \ |
98 retval = tmp(0); \ | 96 \ |
99 } \ | 97 if (tmp.length () > 0) \ |
100 else \ | 98 retval = tmp(0); \ |
101 error ("%s method not defined for %s class", \ | |
102 #name, dispatch_type.c_str ()); \ | |
103 \ | 99 \ |
104 return retval; \ | 100 return retval; \ |
105 } | 101 } |
106 | 102 |
107 DEF_CLASS_BINOP (plus) | 103 DEF_CLASS_BINOP (plus) |