moonscript
moonscript copied to clipboard
block 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
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).
That's sufficient for my needs. Thanks!
why not classic --[[ ?
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.
+1. Real pain not having them.
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.
Any update on this?
There was a PR but it was blocked due to having an issue with a pretty significant hit to compiler speed.
Sorry for the big necropost, but has any progress towards multiline comments been made since?