bugGNU Octave - Bugs: bug #57536, Interpreter no longer indicates...

 
 

bug #57536: Interpreter no longer indicates where error is in line with parse error

Submitter:  Rik <rik5>
Submitted:  Sat 04 Jan 2020 05:18:47 AM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  jwe
Originator Name:  Open/Closed:  * Closed
Release:  * 6.0.90 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 10 Mar 2020 03:20:30 PM UTC, comment #5: 

Much nicer.  Marking as fixed and closing report.

Rik <rik5>
Group administrator
Tue 10 Mar 2020 11:59:29 AM UTC, comment #4: 

I pushed the following changeset:

http://hg.savannah.gnu.org/hgweb/octave/rev/026bff6a54d7

Oops, I just noticed I used the wrong bug number in the commit message.  Wouldn't it be great if errors like that could be fixed in the repo.

Anyway, now I see:


octave:1> x = ls a
error: parse error:

  syntax error

>>> x = ls a
           ^
octave:1> 1 + @
error: parse error:

  syntax error

>>> 1 + @
        ^
octave:1> 1 + &
error: parse error:

  syntax error

>>> 1 + &
        ^
octave:1> 1 + 2 / 4 * 3 + &&
error: parse error:

  syntax error

>>> 1 + 2 / 4 * 3 + &&
                     ^


John W. Eaton <jwe>
Group administrator
Mon 09 Mar 2020 05:44:45 PM UTC, comment #3: 

There once again seem to be some issues with position tracking in the lexer.  For example, I see different results for different input:


octave:1> x = ls 5
error: parse error:

  syntax error

>>> x = ls 5
          ^
octave:1> x + @
error: parse error:

  syntax error

>>> x + @
        ^
octave:1> x + &
error: parse error:

  syntax error

>>> x + &
         ^


I'm looking at ways to make this a bit more reliable.

John W. Eaton <jwe>
Group administrator
Mon 09 Mar 2020 03:12:17 PM UTC, comment #2: 

Much better.  There is still a slight difference from previous versions.  Running test code now


y = ls 5
error: parse error:

  syntax error

>>>  y = ls 5
           ^


The caret is back, but it points to the space before the token that is the problem, rather than directly at the problem token.  Is it possible to add one space more to the caret positioning?

Rik <rik5>
Group administrator
Sun 08 Mar 2020 09:56:58 PM UTC, comment #1: 

I pushed the following change to stable:

http://hg.savannah.gnu.org/hgweb/octave/rev/9e983eb1749d

John W. Eaton <jwe>
Group administrator
Sat 04 Jan 2020 05:18:47 AM UTC, original submission:  

Previously,


y = ls 5
parse error:

  syntax error

>>> y = ls 5
           ^


Now,


 y = ls 5
error: parse error:

  syntax error





Rik <rik5>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

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 (Submitted the item)
  •  

    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.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-03-10 rik5 StatusPatch Reviewed Fixed
        Open/ClosedOpen Closed
        Releasedev 6.0.90
    2020-03-09 rik5 StatusReady For Test Patch Reviewed
    2020-03-08 jwe StatusConfirmed Ready For Test

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code