# HG changeset patch # User Jaroslav Hajek # Date 1269416260 -3600 # Node ID 26a170c87a3985d56f9f902548939850134c9a80 # Parent 03d0dea2309d797615cac7c5b1d450bb37a20028 [mq]: missing.diff diff --git a/scripts/miscellaneous/unimplemented.m b/scripts/miscellaneous/unimplemented.m new file mode 100644 --- /dev/null +++ b/scripts/miscellaneous/unimplemented.m @@ -0,0 +1,412 @@ +## Copyright (C) 2010 John W. Eaton +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +## -*- texinfo -*- +## @deftypefn {Function File} {} unimplemented () +## Undocumented internal function. +## @end deftypefn + +function unimplemented (fcn) + + if (ismember (fcn, missing_functions ())) + + txt = __makeinfo__ (sprintf ("The %s function is not yet implemented in Octave. Please read @url{http://www.octave.org/missing.html} to find out how you can help to contribute a working version of this function.", fcn)); + + warning ("Octave:missing-function",["\n", txt]); + endif + +endfunction + +function list = missing_functions () + persistent list = { + "DelaunayTri", + "MException", + "RandStream", + "TriRep", + "TriScatteredInterp", + "addpref", + "align", + "alim", + "alpha", + "alphamap", + "annotation", + "audiodevinfo", + "audioplayer", + "audiorecorder", + "aufinfo", + "auread", + "auwrite", + "avifile", + "aviinfo", + "aviread", + "bar3", + "bar3h", + "bench", + "betaincinv", + "bicg", + "bicgstabl", + "brush", + "builddocsearchdb", + "bvp4c", + "bvp5c", + "bvpget", + "bvpinit", + "bvpset", + "bvpxtend", + "callSoapService", + "calllib", + "camdolly", + "cameratoolbar", + "camlight", + "camlookat", + "camorbit", + "campan", + "campos", + "camproj", + "camroll", + "camtarget", + "camup", + "camva", + "camzoom", + "cdf2rdf", + "cdfepoch", + "cdfinfo", + "cdfread", + "cdfwrite", + "cellplot", + "checkin", + "checkout", + "cholinc", + "clearvars", + "clipboard", + "cmopts", + "cmpermute", + "cmunique", + "colordef", + "colormapeditor", + "comet3", + "commandhistory", + "commandwindow", + "condeig", + "coneplot", + "contourslice", + "copyobj", + "createClassFromWsdl", + "createSoapMessage", + "curl", + "customverctrl", + "daqread", + "datacursormode", + "datatipinfo", + "dbmex", + "dde23", + "ddeget", + "ddesd", + "ddeset", + "decic", + "depdir", + "depfun", + "deval", + "dialog", + "dither", + "divergence", + "docopt", + "docsearch", + "dragrect", + "dynamicprops", + "echodemo", + "ellipj", + "ellipke", + "erfcinv", + "errordlg", + "evalc", + "exifread", + "expint", + "export2wsdlg", + "figurepalette", + "filebrowser", + "fill3", + "findfigs", + "fitsinfo", + "fitsread", + "flow", + "fminsearch", + "frame2im", + "freqspace", + "funm", + "gallery", + "gammaincinv", + "gco", + "getappdata", + "getframe", + "getpixelposition", + "getpref", + "gmres", + "grabcode", + "graymon", + "gsvd", + "guidata", + "guide", + "guihandles", + "handle", + "hdf", + "hdf5", + "hdf5info", + "hdf5read", + "hdf5write", + "hdfinfo", + "hdfread", + "hdftool", + "helpbrowser", + "helpdesk", + "helpdlg", + "helpwin", + "hgexport", + "hgload", + "hgsave", + "hgsetget", + "hgtransform", + "hostid", + "ilu", + "im2frame", + "im2java", + "imapprox", + "imformats", + "import", + "importdata", + "inmem", + "inputParser", + "inputdlg", + "inspect", + "instrfind", + "instrfindall", + "interpstreamspeed", + "isappdata", + "iscom", + "isinterface", + "isjava", + "isocaps", + "ispref", + "isprop", + "isstudent", + "javaArray", + "javaMethod", + "javaMethodEDT", + "javaObject", + "javaObjectEDT", + "javaaddpath", + "javachk", + "javaclasspath", + "javarmpath", + "ldl", + "libfunctions", + "libfunctionsview", + "libisloaded", + "libpointer", + "libstruct", + "light", + "lightangle", + "lighting", + "linkaxes", + "linkdata", + "linsolve", + "listdlg", + "listfonts", + "loadlibrary", + "lscov", + "lsqr", + "makehgtform", + "material", + "matlabrc", + "maxNumCompThreads", + "memmapfile", + "memory", + "metaclass", + "methodsview", + "minres", + "mlint", + "mlintrpt", + "mmfileinfo", + "mmreader", + "movegui", + "movie", + "movie2avi", + "msgbox", + "multibandread", + "multibandwrite", + "native2unicode", + "noanimate", + "ode113", + "ode15i", + "ode15s", + "ode23", + "ode23s", + "ode23t", + "ode23tb", + "ode45", + "odefile", + "odeget", + "odeset", + "odextend", + "onCleanup", + "open", + "openfig", + "opengl", + "openvar", + "ordeig", + "ordqz", + "ordschur", + "padecoef", + "pagesetupdlg", + "pan", + "parseSoapResponse", + "path2rc", + "pathtool", + "pcode", + "pdepe", + "pdeval", + "pie3", + "playshow", + "plotbrowser", + "plotedit", + "plottools", + "polyeig", + "prefdir", + "preferences", + "printdlg", + "printopt", + "printpreview", + "profile", + "profsave", + "propedit", + "propertyeditor", + "publish", + "qmr", + "quad2d", + "questdlg", + "randi", + "rbbox", + "rectangle", + "recycle", + "reducepatch", + "reducevolume", + "resample", + "reset", + "rgbplot", + "rmappdata", + "rmpref", + "root", + "rotate", + "rotate3d", + "rsf2csf", + "saveas", + "selectmoveresize", + "sendmail", + "serial", + "setappdata", + "setpixelposition", + "setpref", + "showplottool", + "shrinkfaces", + "smooth3", + "snapnow", + "sound", + "soundsc", + "ss2tf", + "stream2", + "stream3", + "streamline", + "streamparticles", + "streamribbon", + "streamslice", + "streamtube", + "strings", + "subvolume", + "superclasses", + "support", + "surf2patch", + "symmlq", + "syntax", + "tetramesh", + "texlabel", + "textscan", + "textwrap", + "tfqmr", + "timer", + "timerfind", + "timerfindall", + "timeseries", + "toolboxdir", + "tscollection", + "tstool", + "uibuttongroup", + "uicontextmenu", + "uicontrol", + "uigetdir", + "uigetfile", + "uigetpref", + "uiimport", + "uimenu", + "uiopen", + "uipanel", + "uipushtool", + "uiputfile", + "uiresume", + "uisave", + "uisetcolor", + "uisetfont", + "uisetpref", + "uistack", + "uitable", + "uitoggletool", + "uitoolbar", + "uiwait", + "undocheckout", + "unicode2native", + "unloadlibrary", + "unmesh", + "usejava", + "userpath", + "validateattributes", + "verLessThan", + "viewmtx", + "visdiff", + "volumebounds", + "waitbar", + "waitfor", + "warndlg", + "waterfall", + "wavfinfo", + "wavplay", + "wavrecord", + "web", + "whatsnew", + "whitebg", + "wk1finfo", + "wk1read", + "wk1write", + "workspace", + "xlsfinfo", + "xlsread", + "xlswrite", + "xmlread", + "xmlwrite", + "xslt", + "zoom", + }; +endfunction diff --git a/src/pt-id.cc b/src/pt-id.cc --- a/src/pt-id.cc +++ b/src/pt-id.cc @@ -25,10 +25,12 @@ #include #endif +#include "defun.h" #include "error.h" #include "oct-obj.h" #include "oct-lvalue.h" #include "pager.h" +#include "parse.h" #include "pt-bp.h" #include "pt-const.h" #include "pt-id.h" @@ -39,17 +41,36 @@ // Symbols from the symbol table. +static std::string Vmissing_function_hook = "unimplemented"; + +DEFUN (missing_function_hook, args, nargout, + "-*- texinfo -*-\n\ address@hidden {Built-in Function} address@hidden =} missing_function_hook ()\n\ address@hidden {Built-in Function} address@hidden =} missing_function_hook (@var{new_val})\n\ +Query or set the internal variable that allows setting a custom hook function\n\ +called when an uknown identifier is requested.\n\ address@hidden deftypefn") +{ + return SET_INTERNAL_VARIABLE (missing_function_hook); +} + void tree_identifier::eval_undefined_error (void) { int l = line (); int c = column (); - if (l == -1 && c == -1) - ::error ("`%s' undefined", name ().c_str ()); - else - ::error ("`%s' undefined near line %d column %d", - name ().c_str (), l, c); + if (! Vmissing_function_hook.empty ()) + feval (Vmissing_function_hook, octave_value (name ())); + + if (! error_state) + { + if (l == -1 && c == -1) + ::error ("`%s' undefined", name ().c_str ()); + else + ::error ("`%s' undefined near line %d column %d", + name ().c_str (), l, c); + } } octave_value_list