bugGNU Octave - Bugs: bug #38958, parse error in function handle...

 
 

bug #38958: parse error in function handle returning string expression

Submitted by:  Clemens Buchacher <drizzd>
Submitted on:  Fri 10 May 2013 09:32:50 AM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Regression
Status: FixedAssigned to: None
Originator Name: Clemens BuchacherOpen/Closed: Closed
Release: devOperating System: Microsoft Windows

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

Sat 18 May 2013 08:23:25 PM UTC, comment #1:

I checked in the following changeset:

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

John W. Eaton <jwe>
Project Administrator
Fri 10 May 2013 09:32:50 AM UTC, original submission:

Tested with MXE build of 3.7.3. Works as expected with 3.6.4 (on mingw32-i686) and 3.4.3 (on x86_64-unknown-linux-gnu).

Octave returns an error while parsing a function handle which returns a string expression. I am using feval only to demonstrate the expected result. The parse error also triggers for @()'foo' by itself.

  • Expected result:

> feval(@()'foo', {})

ans = foo

  • Actual result:

> feval(@()'foo', {})

parse error:

syntax error

>>> feval(@()'foo', {})


A workaround is to use @()x='foo':

> feval(@()x='foo', {})

ans = foo

For types other than String Octave behaves as expected:

> feval(@()1:10, {})

ans =

1 2 3 4 5 6 7 8 9 10

> feval(@()struct('a',5), {})

ans =

scalar structure containing the fields:

a = 5

Clemens Buchacher <drizzd>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

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 drizzd (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 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 18 May 2013 08:23:25 PM UTCjweStatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup