twinbasic / twinbasic

284 stars 23 forks source link

Block comments #97

Closed mansellan closed 3 years ago

mansellan commented 3 years ago

Is your feature request related to a problem? VB6 has no concept of block comments.

Describe the solution you'd like Block comments, using a syntax that is unlikely to confuse legacy editors.

Describe alternatives you've considered Although it's possible to comment multiple lines with ', there's no way to exit a comment block in a logical line.

Additional context C-like languages use /* ... */ to denote a block comment. Not only is this a quick and convenient way of commenting a large range of lines, it also makes it possible to define a commented section inside a single logical line, e.g. public void SomeMethod(/*param1,*/param2). VB6 has no such capability - once the comment marker is added, it applies to the rest of the logical line (survives line continuations).

If implemented, one thing to bear in mind is that it probably should not attempt to reuse the ' marker - this could lead to confusion if a twinBASIC file was opened in a legacy editor. For example, Public Sub Foo('/Param1 as String, '/Param2 As String) would lead to unexpected results. Better to use symbols that are wholly uncompilable in VB6, perhaps /* and */ (just a suggestion, happy to hear of alternatives).

WaynePhillipsEA commented 3 years ago

Great idea. Done! Now available in v0.9.2177

tB_blockComments
Kr00l commented 3 years ago

Cool! In-between comments are very handy. Btw, this is not a "discussion" anymore. :)

mansellan commented 3 years ago

Wow that was fast! Thanks!

Kr00l commented 3 years ago

Out of curiosity I compare some syntax with FreeBasic and found out that the block comment syntax (in FreeBasic) is very VB-Ish.

/'
   Comment, multiple lines
'/