UNPKG

659 BJavaScriptView Raw
1"use strict";
2
3/**
4 * @export {parse}
5 * @function parse
6 * Parse a source code and extract all the special comments.
7 * A comment is special if it starts with "/**" or "///".
8 * Comments are returned as an array of blocs. Comments which are not
9 * separated by non-blank characters are in the same bloc.
10 * @param {string} code - Source code to parse.
11 * @return {array[array[array]]} Array of blocs. A block is an array
12 * of lines. A line is an array with two items: the line number and
13 * the comment's line.
14 */
15module.exports = function( code ) {
16 //
17 var mode = '';
18 var size = code.length;
19 var idx = 0;
20
21 while ( idx < size ) {
22
23 }
24};