dk00 / livescript-next

Enable latest ES features for LiveScript
https://lsn.netlify.com/
The Unlicense
39 stars 3 forks source link

Multi-line comments #18

Open danielo515 opened 5 years ago

danielo515 commented 5 years ago

Hello,

Today I discovered that your library does not support multi line comments. Is this intentional ? Is it a mistake ? Will it be hard to implement ?

With multi line comments I mean this:

/**
 * @function push
 * @param  {Array} arr The array to use as base to push any element
 * @param  {Any} x Any kind of item that will be pushed into the array
 * @return {Array} The array with a new element at the end
 */
function push arr, x
    [...arr, x]

This will allow me to use JSDoc to document my source code, which is very convenient.

As a workaround I can use a string to include the comment:

"
/**
 * @function push
 * @param  {Array} arr The array to use as base to push any element
 * @param  {Any} x Any kind of item that will be pushed into the array
 * @return {Array} The array with a new element at the end
 */
"
function push arr, x
    [...arr, x]

Not pretty but works, and the impact on output is not huge. If you find any other way or do you know anything I could be doing wrong, I'll be glad to hear it.

Regards