moonscript icon indicating copy to clipboard operation
moonscript copied to clipboard

block comments

Open dvv opened this issue 14 years ago • 9 comments

Hi!

How do I do block comments in moonscript? Apart from their vanilla usage, they are handy in switching off blocks of code while debugging.

TIA, --Vladimir

dvv avatar Oct 12 '11 15:10 dvv

Not possible at the moment This is on the todo. If you want, for the time being, you can make a statement of just a string literal, using [==[ or some similar delimiter. Those will be ignored (unless it's the return value of a function).

leafo avatar Oct 12 '11 16:10 leafo

That's sufficient for my needs. Thanks!

dvv avatar Oct 12 '11 17:10 dvv

why not classic --[[ ?

velikanov avatar Feb 09 '14 13:02 velikanov

They'd be nice, it's currently hard to do type-like comments, eg run_server(--[[Port]] 3000, --[[# Channels]] 2). If I'm not mistaken, a string literal would be interpreted as a function call here.

ludamad avatar Jun 23 '14 13:06 ludamad

+1. Real pain not having them.

c0d3rman avatar Jan 25 '15 03:01 c0d3rman

While peeking through the source, I found that some statements are translated to noop or something along those lines; would it be possible to take comments, pass them through moonc, and they just don't return anything? Essentially they disappear as though they were gsub()'d out.

RyanSquared avatar Apr 13 '16 15:04 RyanSquared

Any update on this?

taxilly avatar Apr 13 '18 02:04 taxilly

There was a PR but it was blocked due to having an issue with a pretty significant hit to compiler speed.

RyanSquared avatar Apr 13 '18 16:04 RyanSquared

Sorry for the big necropost, but has any progress towards multiline comments been made since?

TheWitheredStriker avatar Nov 24 '21 16:11 TheWitheredStriker