bugGNU Octave - Bugs: bug #54707, "which" on a function...

 
 

bug #54707: "which" on a function with syntax error shouldn't throw an error

Submitter:  Markus Mützel <mmuetzel>
Submitted:  Fri 21 Sep 2018 07:19:26 PM UTC
   
 
Category:  Octave Function Severity:  1 - Wish
Priority:  5 - Normal Item Group:  Feature Request
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Fri 21 Sep 2018 07:19:26 PM UTC, original submission:  

When calling "which" for a function that cannot be parsed, an error is thrown.
In Octave 4.4.1 and a recent dev:

>> which test_wrong
parse error near line 1 of file D:\temp\test_wrong_syntax.m

  syntax error

>>> function 5 = test_wrong_syntax()
             ^

error: called from
    which at line 34 column 5


Matlab doesn't throw an error when calling "which" for this file:

>> type test_wrong_syntax

function 5 = test_wrong_syntax()

end
>> test_wrong_syntax
Error: File: test_wrong_syntax.m Line: 1 Column: 10
Unexpected MATLAB expression.
>> which test_wrong_syntax
D:\temp\test_wrong_syntax.m
>>


Also in Octave:

>> which test_wrong_syntax.m
'test_wrong_syntax.m' is the file D:\temp\test_wrong_syntax.m


See also bug #54600 where Pantxo wrote: "Personally, what I want when I use "which fcn" is Octave to answer the question "In which file will you search for the definition of fcn?"." to which I agree.

Markus Mützel <mmuetzel>
Group administrator

 

Attached Files

Attached Files
file #45073:  test_wrong_syntax.m added by mmuetzel (38B - application/octet-stream)

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

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Submitted the item)
  •  

    Votes

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

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

    History

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-09-21 mtmiller Severity3 - Normal 1 - Wish
        Item GroupUnexpected Error or Warning Feature Request
        StatusNone Confirmed
    2018-09-21 mmuetzel Attached File- Added test_wrong_syntax.m, #45073

    Back to the top

    Powered by Savane 3.16-046d.
    Corresponding source code