bugGNU Octave - Bugs: bug #42559, Whitespace before struct selection...

 
 

bug #42559: Whitespace before struct selection operator should be ignored

Submitter:  None
Submitted:  Sun 15 Jun 2014 02:06:54 PM UTC
   
 
Category:  Interpreter Severity:  2 - Minor
Priority:  3 - Low Item Group:  Matlab Compatibility
Status:  Confirmed Assigned to:  None
Originator Name:  Chris Carroll Originator Email:  -email is unavailable-
Open/Closed:  * Open Release:  * dev
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 03 Mar 2019 09:08:51 PM UTC, comment #4: 

I haven't investigated, but this looks like a problem with recognizing command style function calls.  So it is similar to things like


a - b  %% looks like an addition expression
a -b   %% looks like a command with an option string


John W. Eaton <jwe>
Group administrator
Sun 03 Mar 2019 06:39:43 PM UTC, comment #3: 

This is still present with the development version 6.0.0.

It's not a big deal, but it seems like this should be easy to fix.  I'm adding jwe to the CC list since he understands the parser/interpreter the best.

Rik <rik5>
Group administrator
Thu 15 Dec 2016 04:38:14 PM UTC, comment #2: 

This behavior is still present in Octave 4.2.0.

Hartmut <hardy>
Mon 16 Jun 2014 12:21:33 AM UTC, comment #1: 

I'm marking the bug as confirmed and lowering the severity to minor since there is an obvious workaround of not using a space between the variable name and period.

Rik <rik5>
Group administrator
Sun 15 Jun 2014 02:06:54 PM UTC, original submission:  

When a struct is created implicitly (i.e., by assigning a value to one of its members), the interpreter does not ignore whitespace before the "." operator. For example, the code in the following try block triggers an exception.


a.x = 1; % OK

try
  b .x = 1; % produces error: 'b' undefined
catch, fprintf('produces exception!\n'); end

c = struct();
c .x = 1; % OK


Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #31554:  testStructSyntax.m added by None (96B - text/plain)

 

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 rik5
  • -email is unavailable- added by hardy (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by None (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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-03 rik5 Carbon-Copy- Added jwe
    2016-12-15 rik5 Release3.8.1 dev
    2014-06-16 rik5 Severity3 - Normal 2 - Minor
        Priority5 - Normal 3 - Low
        StatusNone Confirmed
    2014-06-15 None Attached File- Added testStructSyntax.m, #31554

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code