octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Block comments


From: John W. Eaton
Subject: Re: Block comments
Date: Wed, 12 Jan 2011 13:12:55 -0500

On 12-Jan-2011, Rik wrote:

| > 1) What is the state of block comments? I see that the FAQ has been
| > updated, but only seems to refer to one style of block comments, with
| > %{ %} and not with #{ #}. Do they work like they do in Matlab now?
| Block comments are allowed.  I fear that the FAQ is seriously out-of-date.
|  I added the documentation to the manual, see Section 2.7.2 of Getting
| Started, back in April, 2009.  There is, as you point out, something a
| little odd with the parsing.
| 
| disp (1);
| #{
| disp (2);
| disp (3);#}
| disp (4);
| 
| The code above produces what you would expect:
| 1
| 4
| 
| Having the start of the block on the same line of the code, however,
| produces the odd result that the last commented line is actually run.
| 
| disp (1);
| #{ disp (2);
| disp (3);#}
| disp (4);
| 
| And the output is:
| 
| 1
| 3
| 4
| 
| This, hopefully, is a simple fix in the parser.

If we follow the rules of Matlab, then I think the %{ and %} are only
supposed to be allowed at the beginning of a line (whitespace
ignored).

File a bug report and I'll try to take a look and see if there is a
simple fix.

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]