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 17 Apr 2013 11:25:53 AM UTC  
 
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 20 Jun 2013 02:13:10 AM UTC, 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 19 Jun 2013 10:46:18 PM UTC, 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 11 May 2013 10:06:44 AM UTC, comment #1:

Confirmed.

Clemens Buchacher <drizzd>
Wed 17 Apr 2013 11:25:53 AM UTC, 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 20 Jun 2013 02:13:10 AM UTCjweStatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Wed 19 Jun 2013 11:57:52 PM UTCjweAssigned toNone=>jwe
    Wed 19 Jun 2013 10:46:18 PM UTCrik5SummarySpurious display with nargin=>Parser oddity with 'if' statements and spurious display with nargin
      Carbon-Copy-=>Added jwe
    Sat 11 May 2013 10:44:49 AM UTCjordighStatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup