bugGNU Octave - Bugs: bug #39032, parsing comma after line break

 
 

bug #39032: parsing comma after line break

Submitter:  Clemens Buchacher <drizzd>
Submitted:  Tue 21 May 2013 04:45:02 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Clemens Buchacher Open/Closed:  * Closed
Release:  * 3.6.4 Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 08 Jul 2013 04:29:37 PM UTC, comment #3: 

I checked in the following change:

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

I think this fixes the problem you reported, so I'm closing this bug report.

I forgot to add this bug report number to the changeset log message.  Oops.

John W. Eaton <jwe>
Group administrator
Fri 24 May 2013 06:18:00 PM UTC, comment #2: 

This was already mentioned in #34346.

Guillaume <gyom>
Fri 24 May 2013 03:36:35 PM UTC, comment #1: 

The same problem exists without the line break.  Octave gives a parse error if an array definition begins with a comma or a semicolon:

Octave:

octave:1> a = [,3]
parse error:

  syntax error

>>> a = [,3]
          ^

octave:2> a = [;3]
parse error:

  syntax error

>>> a = [;3]
          ^


Matlab:

>> a = [,3]
a =
     3
>> a = [;3]
a =
     3


Adam H Aitkenhead <adama>
Tue 21 May 2013 04:45:02 PM UTC, original submission:  

This is valid in Matlab 2011b, but not in Octave:

octave:1> [0

> ,1]

parse error:

  syntax error

>>> ,1]

    ^

Matlab output:

>> [0

,1]

ans =

     0
     1

>> [0, 1

, 2, 3]

ans =

     0     1
     2     3

If the line break happens after the comma, Octave is fine with it:

octave.exe:9> [1,

> 0]

ans =

   1
   0

Clemens Buchacher <drizzd>

 

(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 gyom (Posted a comment)
  • -email is unavailable- added by adama (Posted a comment)
  • -email is unavailable- added by drizzd (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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-07-08 jwe StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code