peek and drop comments
180178
def _peek(tokens, n=0):
    """"""
    return tokens.peek(n=n, skip=_is_comment, drop=True)
976915
function parseComment (comment) {
  const body = j('[' + comment + ']').nodes()[0].program.body
  const array = body[0].expression
  return array.elements
}
489128
def skip(self):
        """"""
        buflen = len(self.buf)

        while True:
            self.buf = self.buf.lstrip()
            if self.buf == '':
                self.readline()
                buflen = len(self.buf)
            else:
                self.offset += (buflen - len(self.buf))
                break

        # do not keep comments in the syntax tree
        if not self.keep_comments:
            # skip line comment
            if self.buf[0] == '/':
                if self.buf[1] == '/':
                    self.readline()
                    return self.skip()
            # skip block comment
                elif self.buf[1] == '*':
                    i = self.buf.find('*/')
                    while i == -1:
                        self.readline()
                        i = self.buf.find('*/')
                    self.set_buf(i+2)
                    return self.skip()
1182181
private String readComment(boolean returnText) throws IOException, KriptonRuntimeException {
		read(START_COMMENT);

		if (relaxed) {
			return readUntil(END_COMMENT, returnText);
		}

		String commentText = readUntil(COMMENT_DOUBLE_DASH, returnText);
		if (peekCharacter() != '>') {
			throw new KriptonRuntimeException("Comments may not contain --", true, this.getLineNumber(), this.getColumnNumber(), getPositionDescription(), null);
		}
		position++;
		return commentText;
	}
2912
def _do_comment(self, node):
        '''
        '''
        if not _in_subset(self.subset, node): return
        if self.comments:
            W = self.write
            if self.documentOrder == _GreaterElement: W('\n')
            W('<!--')
            W(node.data)
            W('-->')
            if self.documentOrder == _LesserElement: W('\n')
1175353
def obtain_comments(check = nil)

      if check.blank? && !@content.blank? && @content[0].blank?
        Comment.where(:post_id => @content.id, :comment_approved => 'Y')
      else
        Comment.where(:post_id => check, :comment_approved => 'Y')
      end

    end
1210042
def ConsumeCommentOrTrailingComment(self):
    """"""

    # Tokenizer initializes _previous_line and _previous_column to 0. As the
    # tokenizer starts, it looks like there is a previous token on the line.
    just_started = self._line == 0 and self._column == 0

    before_parsing = self._previous_line
    comment = self.ConsumeComment()

    # A trailing comment is a comment on the same line than the previous token.
    trailing = (self._previous_line == before_parsing
                and not just_started)

    return trailing, comment
1359717
def _split_comment(lineno, comment):
        """"""
        return [(lineno + index, line) for index, line in
                enumerate(comment.splitlines())]
914188
def peek(self):
        '''
        '''

        if self.position >= len(self.tokens):
            return None

        return self.tokens[self.position]
288568
function getComments(id) {
    $.ajax({
     type: 'GET',
     url: opts.getCommentsURL,
     data: {node: id},
     success: function(data, textStatus, request) {
       var ul = $('#cl' + id);
       var speed = 100;
       $('#cf' + id)
         .find('textarea[name="proposal"]')
         .data('source', data.source);

       if (data.comments.length === 0) {
         ul.html('<li>No comments yet.</li>');
         ul.data('empty', true);
       } else {
         // If there are comments, sort them and put them in the list.
         var comments = sortComments(data.comments);
         speed = data.comments.length * 100;
         appendComments(comments, ul);
         ul.data('empty', false);
       }
       $('#cn' + id).slideUp(speed + 200);
       ul.slideDown(speed);
     },
     error: function(request, textStatus, error) {
       showError('Oops, there was a problem retrieving the comments.');
     },
     dataType: 'json'
    });
  }
1270500
function insertComment(comment) {
    var div = createCommentDiv(comment);

    // To avoid stagnating data, don't store the comments children in data.
    comment.children = null;
    div.data('comment', comment);

    var ul = $('#cl' + (comment.node || comment.parent));
    var siblings = getChildren(ul);

    var li = $(document.createElement('li'));
    li.hide();

    // Determine where in the parents children list to insert this comment.
    for(i=0; i < siblings.length; i++) {
      if (comp(comment, siblings[i]) <= 0) {
        $('#cd' + siblings[i].id)
          .parent()
          .before(li.html(div));
        li.slideDown('fast');
        return;
      }
    }

    // If we get here, this comment rates lower than all the others,
    // or it is the only comment in the list.
    ul.append(li.html(div));
    li.slideDown('fast');
  }
806992
function peek(tok) {
        if (typeof(tok) === 'string') {
            return input.charAt(i) === tok;
        } else {
            return tok.test(current);
        }
    }
62199
protected void skipBlockComment() {
        while (!input.current().isEndOfInput()) {
            if (isAtEndOfBlockComment()) {
                return;
            }
            input.consume();
        }
        problemCollector.add(ParseError.error(input.current(), "Premature end of block comment"));
    }
1038312
def comments_between_tokens(token1, token2):
    """"""
    if token2 is None:
        buf = token1.end_mark.buffer[token1.end_mark.pointer:]
    elif (token1.end_mark.line == token2.start_mark.line and
          not isinstance(token1, yaml.StreamStartToken) and
          not isinstance(token2, yaml.StreamEndToken)):
        return
    else:
        buf = token1.end_mark.buffer[token1.end_mark.pointer:
                                     token2.start_mark.pointer]

    line_no = token1.end_mark.line + 1
    column_no = token1.end_mark.column + 1
    pointer = token1.end_mark.pointer

    comment_before = None
    for line in buf.split('\n'):
        pos = line.find('#')
        if pos != -1:
            comment = Comment(line_no, column_no + pos,
                              token1.end_mark.buffer, pointer + pos,
                              token1, token2, comment_before)
            yield comment

            comment_before = comment

        pointer += len(line) + 1
        line_no += 1
        column_no = 1
572278
function getConditionalComment(comment, modify, options) {
    var START_IF = '^\\s*\\[if .*\\]>',
        END_IF = '<!\\[endif\\]\\s*$',
        matchedStartIF = comment.match(new RegExp(START_IF)),
        matchedEndIF = comment.match(new RegExp(END_IF));

    if (comment.match(new RegExp(START_IF + '\\s*$')) || comment.match(new RegExp(START_IF + '<!\\s*$')) ||
            comment.match(new RegExp('^' + END_IF))) {
        return comment.trim();
    }

    if (matchedStartIF && matchedEndIF) {
        var start = matchedStartIF[0],
            end = matchedEndIF[0],
            modified = modify(comment.substring(start.length, matchedEndIF.index), options);

        return (start + modified + end).trim();
    }
}
1260413
def comments(tag, limit=0, flags=0, **kwargs):
    """"""

    return [comment for comment in cm.CommentsMatch(tag).get_comments(limit)]
368964
function getCommentsList(comments) {
  if (!comments.body || !comments.headers) return;

  let pageInfo = getPage(comments.headers.link);
  let pageList = [];

  comments.body.forEach((item) => {
    pageList.push(getComments(item));
  });

  return {
    page: pageInfo,
    list: pageList
  }
}