bugGNU Octave - Bugs: bug #60941, Whitespace now causes parse error...

 
 

bug #60941: Whitespace now causes parse error for postfix increment / decrement operators

Submitter:  None
Submitted:  Mon 19 Jul 2021 03:47:45 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Wont Fix Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * dev
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Tue 22 Mar 2022 05:10:19 PM UTC, comment #6: 

Thanks for sending the reminder.

IIRC, we settled on requiring that postfix increment/decrement operators must "hug" their operand starting with Octave 7. That change was necessary for Matlab compatibility.

Closing as won't fix.

Markus Mützel <mmuetzel>
Group administrator
Tue 22 Mar 2022 05:05:00 PM UTC, comment #5: 

Is this "Fixed" or "Won't Fix"? Is not problem either way.

Anonymous
Fri 20 Aug 2021 09:07:41 PM UTC, comment #4: 

Should we mark this as Won't Fix?  Seems like we had to change the parser to more closely support Matlab command syntax, and this isn't something we have freedom on.

Also, although you could do it before, it's pretty bad from a legibility-of-code perspective not to tie the increment/decrement operators to the variable they are operating on.  Something like


a ++ b


could be interpreted as a postfix increment of variable 'a', a prefix increment of variable 'b', or 'a' plus '+b'.

Rik <rik5>
Group administrator
Fri 23 Jul 2021 02:35:44 PM UTC, comment #3: 

I'm not sure what the best solution is for both improving Matlab compatibility and continuing to support Octave's extended set of operators.  I've opened a discussion here:

https://octave.discourse.group/t/parsing-command-style-function-call-syntax/1414

John W. Eaton <jwe>
Group administrator
Mon 19 Jul 2021 03:55:56 PM UTC, comment #2: 

Possibly related to bug #60882.
CC'ing jwe.

Markus Mützel <mmuetzel>
Group administrator
Mon 19 Jul 2021 03:48:26 PM UTC, comment #1: 

Add to say: Octave version is 7.0.0, hg id bc19d9360bac

Anonymous
Mon 19 Jul 2021 03:47:45 PM UTC, original submission:  

This behavior was found while testing something in bug #60920:


octave:1> foo = 0
foo = 0
octave:2> foo ++
error: foo used as variable and later as function
octave:3> foo++
ans = 0
octave:4> foo
foo = 1
octave:5> ++ foo
ans = 2


Apparently inserting a space after a variable when calling a postfix increment or decrement operator now causes a variable/function parse error.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by mmuetzel
  •  

    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
    2022-03-22 mmuetzel StatusConfirmed Wont Fix
        Open/ClosedOpen Closed
        Operating SystemGNU/Linux Any
    2021-07-19 mmuetzel StatusNone Confirmed
        Dependencies- Depends on bugs #60882
        Carbon-Copy- Added jwe

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code