jashkenas / coffeescript

Unfancy JavaScript
https://coffeescript.org/
MIT License
16.49k stars 1.99k forks source link

Inline block comments #2538

Closed steida closed 11 years ago

steida commented 11 years ago

Javacript supports inline block comments.

var foo = /** @type {number} */ (this.getFoo())

CoffeeScript seems to not support such syntax.

foo = ###* @type {number} ### (@getFoo())
jashkenas commented 11 years ago

Yep -- it doesn't. Because we need to be able to parse and pass through block comments to the corresponding JS, you generally aren't allowed to use them in places where an expression wouldn't be allowed. See previous tickets.

We'd be glad to take a fix that passes them through universally, but we don't know of an implementation.

michaelficarra commented 11 years ago

Parsing for in-line block comments is fixed in redux, I just need to add the (gross, side-effecting) logic to append comments to the following node.

jashkenas commented 11 years ago

Excellent.

michaelficarra commented 11 years ago

off-topic: @jashkenas: I've made a fixed in redux tag and tagged the open issues that are fixed by my compiler.

GeoffreyBooth commented 7 years ago
foo = ###* @type {number} ### (@getFoo())

compiles now via #4572. Sorry it took awhile.