bugGNU Octave - Bugs: bug #56266, octave shows script text from line...

 
 

bug #56266: octave shows script text from line 1 when reporting parse errors

Submitter:  Dmitri A. Sergatskov <dasergatskov>
Submitted:  Sun 05 May 2019 03:23:24 AM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 06 May 2019 10:18:39 PM UTC, comment #6: 

It works fine now (at least for me).

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Mon 06 May 2019 08:43:08 PM UTC, comment #5: 

It looks like there was a small error in that previous change.  I pushed the following additional changeset:

http://hg.savannah.gnu.org/hgweb/octave/rev/4e69b99978b0

John W. Eaton <jwe>
Group administrator
Mon 06 May 2019 02:56:02 AM UTC, comment #4: 

I fixed a similar problem with the following changeset:

http://hg.savannah.gnu.org/hgweb/octave/rev/eb522480d44c

I'll take a look at this bug if no one else is interested in working on it.

John W. Eaton <jwe>
Group administrator
Sun 05 May 2019 05:35:49 PM UTC, comment #3: 

It looks like Octave is always showing the text content from line 1 of the script file when it encounters a parse error. Another simple example:


x = 1;
y = 2;
z = 3;
()



>> zzz
parse error near line 4 of file /tmp/zzz.m

  syntax error

>>> x = 1;
     ^


Mike Miller <mtmiller>
Group Member
Sun 05 May 2019 05:06:41 AM UTC, comment #2: 

Oh, sorry.  I misunderstand this bug report.  Please ignore comment #1

Anonymous
Sun 05 May 2019 05:05:07 AM UTC, comment #1: 

Hi,

Octave's syntax should be

for ii = 1:N
        disp ("Hello!")
endfor


not

for ii in 1:N
        disp ("Hello!")
endfor


Therefore I think this is not a bug.

Anonymous
Sun 05 May 2019 03:23:24 AM UTC, original submission:  

39b4341c3376 tip @

Running  m-file (with an error):


cat t1.m
N = 100
for ii in 1:N
        disp ("Hello!")
endfor


results in wrong/confusing diagnostic message:



./run-octave -q -f
octave:1> t1
parse error near line 2 of file /home/dima/src/octave/gcc_def/t1.m

  syntax error

>>> N = 100
            ^

octave:1>


Running the same commands interactively works as expected:



./run-octave -q -f
octave:1> N=100
N =  100
octave:2> for ii in 1:N
parse error:

  syntax error

>>> for ii in 1:N
            ^

octave:2>


Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>

 

(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

Digest:
   bug dependencies.

 

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

    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 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-05-16 mtmiller Dependencies- bugs #56326 is dependent
    2019-05-07 jwe StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2019-05-06 jwe StatusConfirmed Ready For Test
    2019-05-05 mtmiller StatusNone Confirmed
        Summaryoctave shows error incorrectly octave shows script text from line 1 when reporting parse errors
    2019-05-05 dasergatskov Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code