syavorsky/comment-parser

Is there a way to grab the source code in a comment block?

Closed this issue · 3 comments

Just trying to work out if there is a way to get the source code between an open comment and a closing one.

For example:

/**
 * This is my code answer
 * @param {string} name the name parameter
 * @param {any} value the value of any type
 */

const thing = 'foo';
thing += ' bar';

/** End*/

Which will return the code between the configured open and end comment, so:

const thing = 'foo';
thing += ' bar';

Not as a part of the parser. But having list of the comment blocks with line numbers for opening/closing markers it should be possible to script something on top

Ah gotchya! Thats a good point, i'll give it a shot.

@normal1ze Did you found a solution?