(type, value, start, end, loc)
| 342 | // 7.4 Comments |
| 343 | |
| 344 | function addComment(type, value, start, end, loc) { |
| 345 | var comment; |
| 346 | |
| 347 | assert(typeof start === 'number', 'Comment must have valid position'); |
| 348 | |
| 349 | state.lastCommentStart = start; |
| 350 | |
| 351 | comment = { |
| 352 | type: type, |
| 353 | value: value |
| 354 | }; |
| 355 | if (extra.range) { |
| 356 | comment.range = [start, end]; |
| 357 | } |
| 358 | if (extra.loc) { |
| 359 | comment.loc = loc; |
| 360 | } |
| 361 | extra.comments.push(comment); |
| 362 | if (extra.attachComment) { |
| 363 | extra.leadingComments.push(comment); |
| 364 | extra.trailingComments.push(comment); |
| 365 | } |
| 366 | } |
| 367 | |
| 368 | function skipSingleLineComment(offset) { |
| 369 | var start, loc, ch, comment; |
no test coverage detected