bugGNU Octave - Bugs: bug #38758, Parser oddity with 'if' statements...

 
 

bug #38758: Parser oddity with 'if' statements and spurious display with nargin

Submitted by:  Guillaume <gyom>
Submitted on:  Wed Apr 17 11:25:53 2013  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Other
Status: FixedAssigned to: John W. Eaton <jwe>
Originator Name: GuillaumeOpen/Closed: Closed
Release: devOperating System: Any

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

Thu Jun 20 02:13:10 2013, comment #3:

I checked in the following change.

http://hg.savannah.gnu.org/hgweb/octave/rev/0bf1d559b321

John W. Eaton <jwe>
Project AdministratorIn charge of this item.
Wed Jun 19 22:46:18 2013, comment #2:

I think the problem is also related to the path the parser is taking through if statements. For example, using a pair of parentheses around the condition of the if statement also fixes the problem.

Ordinarily code of the form

STATEMENT1, STATEMENT2

is equivalent to

STATEMENT1
STATEMENT2

as the comma just tells the parser that a new statement has begun. This seems to be the case here for whatever reason.

In fact, I would guess that the problem is that the if conditional is not being greedy enough and stops after accepting nargin. Thus, the parsing results in

Rik <rik5>
Project Administrator
Sat May 11 10:06:44 2013, comment #1:

Confirmed.

Clemens Buchacher <drizzd>
Wed Apr 17 11:25:53 2013, original submission:

Since recent changes in the Octave parser, I observe spurious displays due to lines such as:

it displays:

It doesn't happen with different call syntax:

Guillaume <gyom>

 

(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 (Updated the item)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by rik5
  • -unavailable- added by jordigh (Updated the item)
  • -unavailable- added by drizzd (Posted a comment)
  • -unavailable- added by gyom (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 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu Jun 20 02:13:10 2013jweStatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Wed Jun 19 23:57:52 2013jweAssigned toNone=>jwe
    Wed Jun 19 22:46:18 2013rik5SummarySpurious display with nargin=>Parser oddity with 'if' statements and spurious display with nargin
      Carbon-Copy-=>Added jwe
    Sat May 11 10:44:49 2013jordighStatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup