bugGNU Octave - Bugs: bug #57159, warning missing-semicolon reports...


bug #57159: warning missing-semicolon reports line -1 and column -1 for an array

Submitted by:  None
Submitted on:  Sun 03 Nov 2019 03:33:27 PM UTC  
Category:  Interpreter Severity:  1 - Wish
Priority:  3 - Low Item Group:  Inaccurate Result
Status:  Fixed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  dev
Operating System:  GNU/Linux

Add a New Comment (Rich Markup)

You are not logged in

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


Fri 06 Dec 2019 06:42:54 PM UTC, comment #4: 

I pushed a few changesets aimed at storing beginning and ending locations for all tokens recognized by the lexer.  I hope it improves the accuracy of the line and column info displayed in error messages but I wouldn't be at all surprised if I missed some things.  If you notice incorrect location info in an error message after my recent changes, then please submit bug reports and I'll try to fix.

John W. Eaton <jwe>
Project Administrator
Mon 02 Dec 2019 04:46:42 PM UTC, comment #3: 

Passes the sample code from comment #1.  Marking as fixed and closing report.

Rik <rik5>
Project Administrator
Mon 02 Dec 2019 04:31:28 PM UTC, comment #2: 

I pushed the following changeset.  I noticed that the lexer is not always getting the locations exactly right, and now I have some other questions about how we should be dealing with location info for tokens and expressions in the parser.  But I think this change is an improvement and my questions can be handled in a separate bug report or mailing list discussion.


John W. Eaton <jwe>
Project Administrator
Sun 03 Nov 2019 04:12:47 PM UTC, comment #1: 

Confirmed.  I have uploaded a new example file "f2.m" which I used to reproduce the result.  The contents of f2.m are

function f1()

Running the code with the latest development branch shows

run-octave -f -q
octave:1> warning ("on", "Octave:missing-semicolon");
octave:2> f2
warning: missing semicolon near line -1, column -1 in file '/home/rik/wip/Projects_Mine/octave-dev/f2.m'
warning: function name 'f1' does not agree with function filename '/home/rik/wip/Projects_Mine/octave-dev/f2.m'
error: 'a' undefined near line 2, column 2
error: called from

So some reporting, such as 'a' undefined', correctly identifies the line number, while the missing semicolon warning does not.

(file #47789)

Rik <rik5>
Project Administrator
Sun 03 Nov 2019 03:33:27 PM UTC, original submission:  

user@m $ cat /file
function f1()

octave:1> warning("on", "Octave:missing-semicolon");
octave:2> run("/file");
warning: missing semicolon near line -1, column -1 in file '/file'

If [a] is replaced with a, the reported line and column are 2 and 1 respectively.



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

Attach Files:

Attached Files
file #47789:  f2.m added by rik5 (30B - text/x-matlab)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by rik5 (Updated the item)

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

    Only project members can vote.




    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-12-02 rik5 StatusReady For Test => Fixed
        Open/ClosedOpen => Closed
    2019-12-02 jwe StatusConfirmed => Ready For Test
    2019-11-03 rik5 Attached File- => Added f2.m, #47789
        Severity3 - Normal => 1 - Wish
        Priority5 - Normal => 3 - Low
        Item GroupFeature Request => Inaccurate Result
        StatusNone => Confirmed
        Release5.1.0 => dev

    Back to the top

    Powered by Savane 3.5