bugGNU Octave - Bugs: bug #37132, Parse error with cell arrays

 
 

bug #37132: Parse error with cell arrays

Submitted by:  Guillaume <gyom>
Submitted on:  Fri 17 Aug 2012 03:00:35 PM UTC  
 
Category:  Interpreter Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Guillaume Open/Closed:  Closed
Release:  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 14 Mar 2013 07:17:58 PM UTC, comment #4:

jwe has overhauled the parser and the issue seems to be fixed. Try a Mercurial changeset >= 16303:085976d9ef08.

Rik <rik5>
Project Administrator
Tue 16 Oct 2012 03:20:36 PM UTC, comment #3:

The most likely file is the Bison parser in libinterp/parse-tree/oct-parse.yy. You might also need to check the lexer which feeds the parser. The lexer is in the same directory in file lex.ll.

Rik <rik5>
Project Administrator
Tue 16 Oct 2012 11:03:52 AM UTC, comment #2:

Thanks for the confirmation, Rik.

I agree that the ";" workaround is enough to rank this as a minor issue.

Which file in the Octave codebase is dealing with this?

Guillaume <gyom>
Fri 12 Oct 2012 03:27:50 PM UTC, comment #1:

Confirmed on a recent development tip (10/12/2012).

The syntax you are using is correct. There is a bug in the parser. It should treat the newline ("\n") as the equivalent of ";" when deciding whether to place the next element in either the following column or in a new row.

I'm lowering the severity level since there is a current workaround of always using the ";" to indicate that a new row is desired.

Perhaps this is related, but it only happens with cell arrays. The following code which uses matrices for the inner element, works.

Rik <rik5>
Project Administrator
Fri 17 Aug 2012 03:00:35 PM UTC, original submission:

With MATLAB:

With Octave:

Arguably, the correct syntax might be:

or

but I'm still unsure whether the difference in behaviour is due to MATLAB accepting an invalid syntax or a bug in the Octave parser.

Guillaume <gyom>

 

(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 rik5 (Posted a comment)
  • -email is unavailable- added by gyom (Submitted 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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-03-14 rik5 StatusConfirmed => Fixed
        Open/ClosedOpen => Closed
    2012-10-12 rik5 Severity3 - Normal => 2 - Minor
        Item GroupMatlab Compatibility => Incorrect Result
        StatusNone => Confirmed

    Back to the top


    Powered by Savane 3.3