Mercurial > octave-libgccjit
comparison src/oct-parse.yy @ 11225:8d8e10058df6
move builtin function from dispatch.cc to oct-parse.yy
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 10 Nov 2010 16:09:07 -0500 |
parents | 40206fe759db |
children | 795c97ace02c |
comparison
equal
deleted
inserted
replaced
11224:e0db3f9e9267 | 11225:8d8e10058df6 |
---|---|
4229 print_usage (); | 4229 print_usage (); |
4230 | 4230 |
4231 return retval; | 4231 return retval; |
4232 } | 4232 } |
4233 | 4233 |
4234 DEFUN (builtin, args, nargout, | |
4235 "-*- texinfo -*-\n\ | |
4236 @deftypefn {Loadable Function} {[@dots{}]} builtin (@var{f}, @dots{})\n\ | |
4237 Call the base function @var{f} even if @var{f} is overloaded to\n\ | |
4238 some other function for the given type signature.\n\ | |
4239 @seealso{dispatch}\n\ | |
4240 @end deftypefn") | |
4241 { | |
4242 octave_value_list retval; | |
4243 | |
4244 int nargin = args.length (); | |
4245 | |
4246 if (nargin > 0) | |
4247 { | |
4248 const std::string name (args(0).string_value ()); | |
4249 | |
4250 if (! error_state) | |
4251 { | |
4252 octave_value fcn = symbol_table::builtin_find (name); | |
4253 | |
4254 if (fcn.is_defined ()) | |
4255 retval = feval (fcn.function_value (), args.splice (0, 1), | |
4256 nargout); | |
4257 else | |
4258 error ("builtin: lookup for symbol `%s' failed", name.c_str ()); | |
4259 } | |
4260 else | |
4261 error ("builtin: expecting function name as first argument"); | |
4262 } | |
4263 else | |
4264 print_usage (); | |
4265 | |
4266 return retval; | |
4267 } | |
4268 | |
4234 octave_value_list | 4269 octave_value_list |
4235 eval_string (const std::string& s, bool silent, int& parse_status, int nargout) | 4270 eval_string (const std::string& s, bool silent, int& parse_status, int nargout) |
4236 { | 4271 { |
4237 octave_value_list retval; | 4272 octave_value_list retval; |
4238 | 4273 |