bugGNU Octave - Bugs: bug #36475, classdef: parsing fails if :end...

 
 

bug #36475: classdef: parsing fails if :end syntax is used

Submitted by:  None
Submitted on:  Tue 15 May 2012 11:20:01 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: James LairdOriginator Email: -unavailable-
Open/Closed: ClosedRelease: dev
Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Thu 17 May 2012 04:48:23 AM UTC, comment #4:

I pushed the changeset:

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

Thanks.

John W. Eaton <jwe>
Project Administrator
Wed 16 May 2012 09:27:09 PM UTC, comment #3:

Yeah, well, I can't say I really like the looks of that conditional either way. But I'll try to check in the change later tonight.

I don't really understand why classdef files are given special treatment by this section of code.

John W. Eaton <jwe>
Project Administrator
Wed 16 May 2012 09:15:35 PM UTC, comment #2:

You're right, of course. I chose the easy way while I was chasing it down and should have cleaned up the patch. Sorry!

Anonymous
Wed 16 May 2012 08:33:54 PM UTC, comment #1:

Your patch changes

to

Isn't that equivalent to

?

John W. Eaton <jwe>
Project Administrator
Tue 15 May 2012 11:20:01 PM UTC, original submission:

Any classdef code containing 'end'-based indexing fails to parse, as the 'end' is treated as an end token rather than an indexing keyword.

A test case and patch are attached.

:2> classdef_test_end
parse error near line 5 of file /home/jhl/classdef_test_end.m
syntax error

>>> foo(end-5:end) = [];

^

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #25863:  classdef_test_end.m added by None (142B - text/x-objcsrc)
file #25864:  classdef_end.patch added by None (527B - text/x-patch)

 

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 None (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
    Thu 17 May 2012 04:48:23 AM UTCjweStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Tue 15 May 2012 11:20:01 PM UTCNoneAttached File-=>Added classdef_test_end.m, #25863
      Attached File-=>Added classdef_end.patch, #25864

    Back to the top


    Powered by Savane 3.1-cleanup1