[Gambas-user] Comment Blocks

Tobias Boege taboege at gmail.com
Wed Apr 24 20:20:39 CEST 2019


On Sat, 20 Apr 2019, Cedron Dawg wrote:
> Kind of slow around here, so here is something to ponder.
> 
> I'm wondering what others think about the ability to have comment blocks.  In C, I use them as intended, but they are also darn handy to block out sections of code while debugging.  The same would be true in Gambas.
> 
> I would suggest using the much underutilized reverse apostrophe (aka grave accent or backquote), living lonely under the tilde on most keyboards, in combination with the traditional apostrophe to make the demarcation quite clear.
> 
> '`  Anything here is comment...(including multiple lines)..... `'
> 
> Kind of makes them look like stylish double quotes.
> 
> I haven't tried these yet:  http://gambaswiki.org/wiki/doc/helpcomments
> 
> But they could be done as '`'''  ....     `' and '`''  ....     `' respectively.
> 
> Thoughts?
> 

My initial thought about this was: it adds complexity that wasn't there
before. If you write a syntax highlighter for Gambas right now, you do not
have to keep track of state between lines. You can analyze all lines
independently of each other, in parallel, in a random order if you wish.
A fully-fledged parser of course doesn't benefit this greatly from it,
and the Gambas internals seem relatively agnostic about if, but a syntax
highlighter is what I'm currently working on (in vimscript, if you have
to ask, so keeping state *is* an issue).

But, this property is lost anyway once we get line continuation characters,
by Bug#1540.

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk


More information about the User mailing list