bugGNU Octave - Bugs: bug #45967, More consistent error message...

 
 

bug #45967: More consistent error message style for parse errors

Submitted by:  Ceral Paquet <octavebugs>
Submitted on:  Tue 15 Sep 2015 12:19:24 AM UTC  
 
Category: InterpreterSeverity: 1 - Wish
Priority: 5 - NormalItem Group: Feature Request
Status: Need InfoAssigned to: None
Originator Name: Open/Closed: Open
Release: 4.0.0Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 16 Sep 2015 12:16:26 PM UTC, comment #2:

I think the "parse error" messages come from the yyerror (or octave_error) function in the parser and that's separate from the error handling code that is used when code is evaluated in Octave.

It does make sense to me to at least unify the way error messages are displayed.

John W. Eaton <jwe>
Project Administrator
Tue 15 Sep 2015 02:10:36 AM UTC, comment #1:

This is interesting. My first instinct is to say that they are really two different kinds of errors, but I realized that command syntax allows "sentences" like the first example to work just fine. Maybe "i" is a special case in that it is both syntax and a built-in function named "i".

But compare

Both "i" and "fft" are built-in functions, but with "fft" it does the normal conversion from command to function call, and the error is different.

Perhaps it is a bug that "i am a bug" is flagged as a syntax error rather than an invalid function call to the function named "i", but that's about it.

If your function were

the same "parse error" would be thrown, because it is illegal syntax, not just an invalid function call or reference to an unknown variable.

Mike Miller <mtmiller>
Project Administrator
Tue 15 Sep 2015 12:19:24 AM UTC, original submission:

function myfoo()

i am a bug

endfunction

function mybar()

i_am_a_bug

endfuction

-----------------

>> myfoo

parse error near line 3 of file /home/ceral/octave/myfoo.m

syntax error

>>> i am a bug

^

>> mybar

error: 'i_am_a_bug' undefined near line 3 column 1
error: called from
mybar at line 3 column 1

Would it be possible to use the same style for these two types of error? Perhaps the latter is slightly tidier. How about:

>> myfoo

error: syntax error near line 3 column 1
error: called from
myfoo.m at line 3 column 1

What would be awesome is to have the final line be clickable and take you to that file and line in the Editor.

Ceral Paquet <octavebugs>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by octavebugs (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 15 Sep 2015 02:10:36 AM UTCmtmillerCategoryNone=>Interpreter
      Severity3 - Normal=>1 - Wish
      Item GroupNone=>Feature Request
      StatusNone=>Need Info

    Back to the top


    Powered by Savane 3.1-cleanup1