bugGNU Octave - Bugs: bug #57924, Comment not treated as a comment...


bug #57924: Comment not treated as a comment when it has unbalanced parentheses or brackets

Submitted by:  None
Submitted on:  Sat 29 Feb 2020 04:54:01 AM UTC  
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  6.0.90
Operating System:  Any

Add a New Comment (Rich Markup)

You are not logged in

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


Mon 09 Mar 2020 04:04:53 PM UTC, comment #4: 

The bugfix works perfectly. Thank you, jwe! Comments are behaving the way they used to.

Mon 09 Mar 2020 02:28:09 PM UTC, comment #3: 

I pushed the following change on stable and merged with default.  Please let me know as soon as possible if it doesn't work for you or causes any other problems.


John W. Eaton <jwe>
Project Administrator
Tue 03 Mar 2020 02:56:50 AM UTC, comment #2: 

There's a simpler test case. Type # at the command prompt and then enter. The prompt changes to looking for more input. Pressing enter causes the comment to finish and the normal prompt to come back.

The trailing carriage return character is suppressed by the # symbol and the lexer waits for more input. Entering a carriage return causes the comment to be completed.

There's no dependence on parentheses or brackets but the multiple line comments with braces are broken differently like Mike Miller says.

Sat 29 Feb 2020 08:52:19 PM UTC, comment #1: 

Confirmed on the default branch and on the version 6 stable branch. This is certainly weird behavior, but only affects comments entered on the command line.

The comment is treated as a comment, but the open bracket or parenthesis is also causing the lexer to look for more input on the next line.

This may have also broken block comments (with '#{' and '#}') entered on the command line, although the broken behavior is slightly different.

This may have something to do with a recent change to the lexer to fix continuation lines within open arrays (https://hg.savannah.gnu.org/hgweb/octave/rev/1db62b2d6c39).

Mike Miller <mtmiller>
Project Administrator
Sat 29 Feb 2020 04:54:01 AM UTC, original submission:  

Type #( or #[ at the command prompt and enter. Expected behavior: the line is treated as a comment and disregarded. Instead, the command line waits for the closing character to be entered, then gives a parse error / syntax error. The same problem happens when commenting out a (partially typed) line with more ( symbols than ) symbols. The bracket counter should be suppressed by the leading # symbol.



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

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by jwe (Updated the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-03-12 mtmiller StatusReady For Test => Fixed
        Open/ClosedOpen => Closed
    2020-03-09 jwe StatusConfirmed => Ready For Test
    2020-02-29 mtmiller Item GroupIncorrect Result => Regression
        StatusNone => Confirmed
        Releasedev => 6.0.90

    Back to the top

    Powered by Savane 3.5