Forums

documentation: minor fixes

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

documentation: minor fixes

Postby ptokremin » Thu Jul 10, 2014 7:47 am

Hi,

the CodeDoc-page documents a compiler directive. After searching the sources (CobraTokenizer.cobra line 939) I corrected a typo: (.nowarnings .) to .no-warnings.
I hope that's ok.

Incidentally Cobra seems to support nested comments :-)
/# this should be no longer used, let's find out who still does
class dummy
/# these members are obsolete...
val longDescription as String
val shortDescription as String #/
pro description as String
get
pass # ToBeDone
#/

Should this be documented as well?

kind regards
ptokremin
ptokremin
 
Posts: 9
Location: Ruhrgebiet - Germany

Re: documentation: minor fixes

Postby hopscc » Thu Jul 17, 2014 2:23 am

(Sorry missed this earlier )

Such nesting support is unintentional
single line and embedded comments can be nested in multiline ones but
multiline comments arent intended to arbitrarily nest....

What you're seeing is a consequence of the multiline comment delimiter recognition which is done such that each delimiter is intended to be placed on its own line with possible leading/trailing whitespace only ....
( the major intended use here is to comment out otherwise non multiline commented blocks of code)

/#
multi line comment
# single line comment
doo.dah /# sing a song # /
# real end comment delimiter below
#/
.realcode # actual code call


( the wiki/trac code highlighting as shown here is slightly different again - 'recognises' end multiline comment token anywhere)
hopscc
 
Posts: 631
Location: New Plymouth, Taranaki, New Zealand

Re: documentation: minor fixes

Postby Charles » Sun Sep 14, 2014 2:11 pm

I believe that I always intended comments to be nestable. There is even a test case for it to make sure it works:

CobraWorkspace/Tests/110-basics-two/160-lines-and-comments/210-multiline-comment-nested.cobra

Am I missing something in this thread?
Charles
 
Posts: 2510
Location: Los Angeles, CA


Return to Discussion

Who is online

Users browsing this forum: No registered users and 4 guests

cron