bugGNU Octave - Bugs: bug #52075, Classdef local functions with same...

 
 

bug #52075: Classdef local functions with same name as methods cause parse error

Submitted by:  Piotr Held <jsoh425>
Submitted on:  Wed 20 Sep 2017 05:55:22 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: FixedAssigned to: None
Originator Name: Piotr HeldOpen/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Thu 21 Sep 2017 04:11:08 PM UTC, comment #2:

I made a couple of minor changes and pushed your changeset here:

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

Thanks for the patch and new test.

John W. Eaton <jwe>
Project Administrator
Wed 20 Sep 2017 10:48:26 PM UTC, comment #1:

I wrote a patch for this problem. It is basically one if statement that prepend the base_lexer::fcn_file_name to the local function name to make it different from the method name when calling parent_scope_info::name_ok(). As the comments to name_ok() state the names just have to be unique.

I also added a test for this bug.

(file #41852)

Piotr Held <jsoh425>
Wed 20 Sep 2017 05:55:22 PM UTC, original submission:

When creating a class with a local function that has the same name as a classdef method the parser issues error about duplicate subfunction or nested function names. An example test class would be:

I also attached this class as an mfile to this bug submission.

Piotr Held <jsoh425>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #41847:  local_fcn_methods.m added by jsoh425 (162B - text/x-objcsrc)

 

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 jsoh425 (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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 21 Sep 2017 04:11:08 PM UTCjweStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Wed 20 Sep 2017 10:48:26 PM UTCjsoh425Attached File-=>Added local_method_dup_patch.diff, #41852
    Wed 20 Sep 2017 05:55:22 PM UTCjsoh425Attached File-=>Added local_fcn_methods.m, #41847

    Back to the top


    Powered by Savane 3.1-cleanup1