octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Modifications to error handling for the command suggestion feature


From: Sudeepam Pandey
Subject: Modifications to error handling for the command suggestion feature
Date: Sat, 19 May 2018 23:32:36 +0530

All,

I'm starting to guess that adding a command suggestion feature would require some changes to the error handling.

Rik, you had been helping me figure out how the feature would integrate itself with Octave and therefore, your help would be particularly appreciated here.

Now here's the thing. From our previous discussions[1] we concluded that some modifications to __unimplemented.m__ would successfully integrate a command suggestion feature with octave. However, I've found a small problem with that.

I'd like to demonstrate the problem with an example. Here I have tried to call the cconv function, a part of the signal package without actually installing the package.

This is what I get...
--------------------------------------------
>> cconv
warning: the 'cconv' function belongs to the signal package from Octave Forge
which seems to not be installed in your system.

Please read <https://www.octave.org/missing.html> to learn how you can
contribute missing functionality.
error: 'cconv' undefined near line 1 column 1
---------------------------------------------

Notice that Octave first tells us something about cconv, this message is generated by the file scripts/help/__unimplemented.m__ after this the actual error message is generated which I have found out is generated by the file libinterp/parse-tree/pt-id.cc

The fault is that, for an effective integration, the preferable thing would be to first print out the 'undefined near line' error message, and then tell us something about the identifier which the parser did not recognize. Here is the reason...

After the suggestion feature presents the corrections to the user, it would provide them with a way to easily execute those commands. If we implement the feature the way it has been discussed, The user would get a suggestion and a prompt to select and execute the command they actually intended to execute... the problem would be that they would receive the error message of their mistake, after they have executed the correct command, and this would definitely be a poor design.

Now I suppose that I have been able to understand the exact file where the call to the missing_function_hook() should be made.Currently it is in the line number 56 of the file pt-id.cc. However, a call from the line number 540 of the file error.cc should do the trick. However, I am not able to understand how to make this call.

If I paste the exact same line 56 from pt-id.cc to line 540 of error.cc I get a name cannot be used as a function error while building. The lack of understanding, obviously is because of not having c++ on my fingertips like Octave so help would be appreciated.

Could anyone help me understand how that call could be made or maybe, help me figure out a better way to make octave first print out the 'undefined near line' error message and then tell us something about the identifier which parser did not recognize? (perhaps some better place to make the call from?)


[1]: http://lists.gnu.org/archive/html/octave-maintainers/2018-04/msg00207.html

Thankyou,
P Sudeepam

reply via email to

[Prev in Thread] Current Thread [Next in Thread]