Return the next comment found in text starting at start.
355061
def nextComment(self, text, start=0):
        

        m = min([self.lineComment(text, start),
                 self.blockComment(text, start),
                 self._emptylineregex.search(text, start)],
                key=lambda m: m.start(0) if m else len(text))
        return m
1359717
def _split_comment(lineno, comment):
        """"""
        return [(lineno + index, line) for index, line in
                enumerate(comment.splitlines())]
843138
def collect_first_comment(body)
      comment = ""
      not_comment = ""
      comment_start = false
      comment_end   = false
      body.split("\n").each{ |line|
        if comment_end
          not_comment << line
          not_comment << "\n"
        elsif /^\s*?!\s?(.*)$/i =~ line
          comment_start = true
          comment << $1
          comment << "\n"
        elsif /^\s*?$/i =~ line
          comment_end = true if comment_start && COMMENTS_ARE_UPPER
        else
          comment_end = true
          not_comment << line
          not_comment << "\n"
        end
      }
      return comment, not_comment
    end
1041647
def next(self):
    """"""
    if self._fut is None:
      self._fut = self._iter.getq()
    try:
      try:
        # The future result is set by this class's _extended_callback
        # method.
        # pylint: disable=unpacking-non-sequence
        (ent,
         self._cursor_before,
         self._cursor_after,
         self._more_results) = self._fut.get_result()
        return ent
      except EOFError:
        self._exhausted = True
        raise StopIteration
    finally:
      self._fut = None
1273832
function(line, isInComment) {
  while (true || line.length > 0) {
    var startIndex = line.indexOf('{-');
    var endIndex = line.indexOf('-}');
    var singleLineComment = line.indexOf('--');

    // when we have a single line comment
    if (singleLineComment > -1 && !isInComment) {
      line = line.substr(0, singleLineComment);
      continue;
    }

    // when there's no comment chars
    if (startIndex === -1 && endIndex === -1) {
      return {
        line: isInComment ? '' : line,
        isInComment: isInComment,
      };
    }

    // when there's a start and end
    if (startIndex > -1 && endIndex > -1) {
      line = line.substr(0, startIndex) + line.substr(endIndex + 2);
      continue;
    }

    // when there's a start, but no end
    if (startIndex > -1)
      return { line: line.substr(0, startIndex), isInComment: true };

    // when there's an end, but no start
    if (endIndex > -1 && isInComment)
      return { line: line.substr(endIndex + 2), isInComment: false };
  }

  return { line: '', isInComment: isInComment };
}
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;
	}
537009
def prev_content(self, start, amount=1):
        """"""
        while start > 0 and self.code[start] in (' ', '\t', '\n'):
            start -= 1

        return self.code[(start or amount) - amount: start]
1206424
def findStmtStart(self, block):
        
        prevBlock = self._prevNonCommentBlock(block)
        while prevBlock.isValid() and \
              (((prevBlock == block.previous()) and self._isBlockContinuing(prevBlock)) or \
               self.isStmtContinuing(prevBlock)):
            block = prevBlock
            prevBlock = self._prevNonCommentBlock(block)
        return block
1159822
def raw_comment(self):
        """"""
        r = conf.lib.clang_Cursor_getRawCommentText(self)
        if not r:
            return None
        return str(r)
357926
public boolean nextLineExceptComments() throws IOException {
    while(nextLine()) {
      if(comment == null || !comment.reset(buf).matches()) {
        tokenizer.initialize(buf, 0, buf.length());
        return true;
      }
    }
    return false;
  }
973791
def verbose_comment(self, t, i):
        """"""

        current = []
        escaped = False

        try:
            while t != "\n":
                if not escaped and t == "\\":
                    escaped = True
                    current.append(t)
                elif escaped:
                    escaped = False
                    if t in self._new_refs:
                        current.append("\\")
                    current.append(t)
                else:
                    current.append(t)
                t = next(i)
        except StopIteration:
            pass

        if t == "\n":
            current.append(t)
        return current
1147478
def icomments(self, tag, limit=0):
        """"""

        for comment in CommentsMatch(tag).get_comments(limit):
            yield comment
1260413
def comments(tag, limit=0, flags=0, **kwargs):
    """"""

    return [comment for comment in cm.CommentsMatch(tag).get_comments(limit)]
233492
def next_items(self, n):
        
        items = []
        while len(items) < n:
            if self._line_ptr >= len(self._line):
                # Load the next line.
                line = next(self._file).strip()
                # Skip all comment and empty lines.
                while not line or line[0] == "#":
                    line = next(self._file).strip()
                self._line = self._re_delimiter.split(line)
                self._line_ptr = 0
            n_read = min(n - len(items), len(self._line) - self._line_ptr)
            items.extend(self._line[self._line_ptr : self._line_ptr + n_read])
            self._line_ptr += n_read
        return items
836271
def next(self):
        """"""
        d = None
        if self._first_results:
            d = succeed(EsUtils.extract_hits(self._first_results))
            self._first_results = None
        elif self._scroll_id:
            d = self._scroll_next_results()
        else:
            raise StopIteration()
        return d
811902
def _strip_comments(line, comments=None):
        """"""
        if comments is None:
            comments = []

        new_comments = False
        comment_start = line.find("#")
        if comment_start != -1:
            comments.append(line[comment_start + 1:].strip())
            new_comments = True
            line = line[:comment_start]

        return line, comments, new_comments
1039395
def _parse_comment(self):
        """"""
        self._head += 4
        reset = self._head - 1
        self._push()
        while True:
            this = self._read()
            if this == self.END:
                self._pop()
                self._head = reset
                self._emit_text("<!--")
                return
            if this == self._read(1) == "-" and self._read(2) == ">":
                self._emit_first(tokens.CommentStart())
                self._emit(tokens.CommentEnd())
                self._emit_all(self._pop())
                self._head += 2
                if self._context & contexts.FAIL_NEXT:
                    # _verify_safe() sets this flag while parsing a template
                    # or link when it encounters what might be a comment -- we
                    # must unset it to let _verify_safe() know it was correct:
                    self._context ^= contexts.FAIL_NEXT
                return
            self._emit_text(this)
            self._head += 1