assemblyscript icon indicating copy to clipboard operation
assemblyscript copied to clipboard

Support @inline inside single line comment

Open jacob-ebey opened this issue 2 years ago • 1 comments

Feature suggestion

The @inline annotation breaks the ability to have a single codebase that can be compiled via AssemblyScript and also ran natively in a JS engine that supports typescript.

I suggest adding the ability to inline functions behind a single line comment

// @inline
function criticalFunc(): void {}

or a tripple slash single line comment

/// @inline
function criticalFunc(): void {}

jacob-ebey avatar Jul 18 '23 22:07 jacob-ebey

I have tried to implement it, but found it needs lots of refactor in parser module. At current time, comment is handled by tokenizer and skip it directly. @dcodeIO WDYT? Should we introduce a new preprocess to handle comment or refactor tokenizer and parser module.

HerrCai0907 avatar Oct 04 '23 11:10 HerrCai0907