bugGNU Octave - Bugs: bug #32598, Wishlist : More C-like multi-line...

 
 

bug #32598: Wishlist : More C-like multi-line block comments

Submitter:  Rik <rik5>
Submitted:  Fri 25 Feb 2011 07:43:08 PM UTC
   
 
Category:  Interpreter Severity:  1 - Wish
Priority:  1 - Later Item Group:  Feature Request
Status:  Wont Fix Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 25 Apr 2018 03:36:51 PM UTC, comment #2: 

Looking at some old bug reports that are still open...

Octave was changed at some point to only recognize the end of a block comment marker "#} or %}" if it appears as the beginning of a line (not counting space characters).

I think this is probably the safest thing to do for compatibility since it is possible that some working Matlab code could have


%{
  this is a block comment %}
  still a block comment in Matlab
%}


and if we changed the rules to recognize the first "%}" above as the end of the block comment, this valid Matlab code would fail in Octave.

So I think this report should be closed as "won't fix".

A related issue is that there could be some working Matlab code that looks like this:


%{
  block comment
#}
  still a block comment in Matlab
%}


and that will fail in Octave.  I'll open a separate bug report about this issue.

John W. Eaton <jwe>
Group administrator
Fri 11 Mar 2011 02:28:18 PM UTC, comment #1: 

Currently

#{
  cos (1);
  sin (1); #}

works as does:

%{
  cos (1);
  sin (1); %}

For reference, neither works in Matlab. Suggestion: make the opening '#{' comment marker easier to use as suggested (if it's easy), but make the '%' comments be consistent with Matlab: force the '%}' to be on a line by itself.

Iain Murray <imurray>
Fri 25 Feb 2011 07:43:08 PM UTC, original submission:  

Octave already supports multi-line block comments using #{/#} pairs.  The current parser expects the keywords to be alone on a single line.  It would be nice if this behavior could be extended to be closer to C-stytle /* */ commenting which can appear anywhere in the line.  If this is at all tricky to implement then it is not worth it and this issue can be closed.

Currently parser example:

#{
  cos (1);
  sin (1);
#}
  tan (1);


Desired parser example:

#{ cos (1);
  sin (1); #}
  tan (1);


Rik <rik5>
Group administrator

 

(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: None found

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by imurray (Posted a comment)
  • -email is unavailable- added by rik5 (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 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-04-25 jwe StatusPostponed Wont Fix
        Open/ClosedOpen Closed
    2015-03-14 mtmiller Priority2 1 - Later
        StatusNone Postponed
        Operating SystemGNU/Linux Any
    2011-05-15 rik5 Dependencies- bugs #33297 is dependent
    2011-02-25 rik5 Priority5 - Normal 2

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code