Return true if the text is a line comment.
549791
def isLineComment(self, text):
        

        m = self.lineComment(text, 0)
        return m and m.start(0) == 0 and m.end(0) == len(text)
699442
def hacking_has_only_comments(physical_line, filename, lines, line_number):
    
    if line_number == 1 and all(map(EMPTY_LINE_RE.match, lines)):
        return (0, "H104: File contains nothing but comments")
416028
def ln_comment(self, ln):
        """"""
        if self.keep_lines:
            if not 1 <= ln <= len(self.original_lines) + 1:
                raise CoconutInternalException(
                    "out of bounds line number", ln,
                    "not in range [1, " + str(len(self.original_lines) + 1) + "]",
                )
            elif ln == len(self.original_lines) + 1:  # trim too large
                lni = -1
            else:
                lni = ln - 1
        if self.line_numbers and self.keep_lines:
            if self.minify:
                comment = str(ln) + " " + self.original_lines[lni]
            else:
                comment = " line " + str(ln) + ": " + self.original_lines[lni]
        elif self.keep_lines:
            if self.minify:
                comment = self.original_lines[lni]
            else:
                comment = " " + self.original_lines[lni]
        elif self.line_numbers:
            if self.minify:
                comment = str(ln)
            else:
                comment = " line " + str(ln)
        else:
            return ""
        return self.wrap_comment(comment, reformat=False)
287375
def _iscomment(line):
    
    if line.isspace():
        return True
    elif len(line.split()) >= 3:
        try:  # python 3 str
            if line.split()[0].isdecimal() and line.split()[1].isdecimal():
                return False
        except:  # python 2 str
            if (line.decode().split()[0].isdecimal() and
                    line.split()[1].decode().isdecimal()):
                return False
        return True
    else:
        return True
570654
def is_quoted(position, text):
    """"""
    def matching(quotemark1, quotemark2):
        straight = '\"\''
        curly = '“”'
        if quotemark1 in straight and quotemark2 in straight:
            return True
        if quotemark1 in curly and quotemark2 in curly:
            return True
        else:
            return False

    def find_ranges(text):
        s = 0
        q = pc = ''
        start = None
        ranges = []
        seps = " .,:;-\r\n"
        quotes = ['\"', '“', '”', "'"]
        for i, c in enumerate(text + "\n"):
            if s == 0 and c in quotes and pc in seps:
                start = i
                s = 1
                q = c
            elif s == 1 and matching(c, q):
                s = 2
            elif s == 2:
                if c in seps:
                    ranges.append((start+1, i-1))
                    start = None
                    s = 0
                else:
                    s = 1
            pc = c
        return ranges

    def position_in_ranges(ranges, position):
        for start, end in ranges:
            if start <= position < end:
                return True
        return False

    return position_in_ranges(find_ranges(text), position)
625941
def strip_comments(text):
    
    regex = r'\s*(#|\/{2}).*$'
    regex_inline = r'(:?(?:\s)*([A-Za-z\d\.{}]*)|((?<=\").*\"),?)(?:\s)*(((#|(\/{2})).*)|)$'  # noqa
    lines = text.split('\n')

    for index, line in enumerate(lines):
        if re.search(regex, line):
            if re.search(r'^' + regex, line, re.IGNORECASE):
                lines[index] = ""
            elif re.search(regex_inline, line):
                lines[index] = re.sub(regex_inline, r'\1', line)

    return '\n'.join(lines)
980518
private boolean multiLineComment(Data data) throws TemplateException {
	SourceCode cfml = data.srcCode;
	if (!cfml.forwardIfCurrent("/*")) return false;
	int pos = cfml.getPos();
	boolean isDocComment = cfml.isCurrent('*');
	while (cfml.isValidIndex()) {
	    if (cfml.isCurrent("*/")) break;
	    cfml.next();
	}
	if (!cfml.forwardIfCurrent("*/")) {
	    cfml.setPos(pos);
	    throw new TemplateException(cfml, "comment is not closed");
	}
	if (isDocComment) {
	    String comment = cfml.substring(pos - 2, cfml.getPos() - pos);
	    data.docComment = docCommentTransformer.transform(data.factory, comment);
	}
	return true;
    }
1146960
def comment(text)
      if text[0..1] == '!['
        revealed = true
        text = text[1..-1]
      else
        revealed = false
      end

      conditional, text = balance(text, ?[, ?]) if text[0] == ?[
      text.strip!

      if contains_interpolation?(text)
        parse = true
        text = unescape_interpolation(text)
      else
        parse = false
      end

      if block_opened? && !text.empty?
        raise SyntaxError.new(Haml::Error.message(:illegal_nesting_content), @next_line.index)
      end

      ParseNode.new(:comment, @line.index + 1, :conditional => conditional, :text => text, :revealed => revealed, :parse => parse)
    end
219956
function (text) {
            if (isConditionalComment(text)) {
                text = cleanConditionalComment(text);
                MinifyWriter.superclass.comment.call(this, text);
            }
        }
1245566
def comment_text
      begin
        text = @scanner.scan(/.*/) # everything until newline
        text.rstrip! # benchmarked faster too rstrip the string in place
        raise PoSyntaxError, "Comment text should advance to next line or stop at eos" unless end_of_line
        text
      rescue PoSyntaxError => pe
        raise PoSyntaxError, "Syntax error in commtent_text\n" + pe.message, pe.backtrace
      end
    end
969314
function hasCommentBefore(node, sourceCode) {
  return sourceCode.getCommentsBefore(node)
    .some(comment => comment.loc.end.line >= node.loc.start.line - 1)
}
1267475
def _comment_type_from_line(line):
    
    regex = re.compile(r"^{0}".format(_ALL_COMMENT))
    match = regex.match(line)
    if match:
        return "{0} ".format(line[match.start():match.end()])

    raise RuntimeError("Unable to find comment header for {0}".format(line))
1140853
private boolean commentLinesBefore( String content, int line ) {
        int offset = rootElement.getElement(line).getStartOffset();
        // Start of comment not found, nothing to do
        int startDelimiter = lastIndexOf(content, getStartDelimiter(), offset - 2);
        if (startDelimiter < 0)
            return false;
        // Matching start/end of comment found, nothing to do
        int endDelimiter = indexOf(content, getEndDelimiter(), startDelimiter);
        if (endDelimiter < offset & endDelimiter != -1)
            return false;
        // End of comment not found, highlight the lines
        doc.setCharacterAttributes(startDelimiter, offset - startDelimiter + 1, comment, false);
        return true;
    }
347437
def comment(self, text, comment_prefix='#'):
        
        comment = Comment(self._container)
        if not text.startswith(comment_prefix):
            text = "{} {}".format(comment_prefix, text)
        if not text.endswith('\n'):
            text = "{}{}".format(text, '\n')
        comment.add_line(text)
        self._container.structure.insert(self._idx, comment)
        self._idx += 1
        return self
312270
def set_quoted_text(self, quoted_text):
        """"""
        self.quoted_text = quoted_text
        self.line_comment = False
        return self
934690
function isInCommentHelper(sourceFile, position, predicate) {
        var token = getTokenAtPosition(sourceFile, position);
        if (token && position <= token.getStart(sourceFile)) {
            var commentRanges = ts.getLeadingCommentRanges(sourceFile.text, token.pos);
            // The end marker of a single-line comment does not include the newline character.
            // In the following case, we are inside a comment (^ denotes the cursor position):
            //
            //    // asdf   ^\n
            //
            // But for multi-line comments, we don't want to be inside the comment in the following case:
            //
            //    /* asdf */^
            //
            // Internally, we represent the end of the comment at the newline and closing '/', respectively.
            return predicate ?
                ts.forEach(commentRanges, function (c) { return c.pos < position &&
                    (c.kind == 2 /* SingleLineCommentTrivia */ ? position <= c.end : position < c.end) &&
                    predicate(c); }) :
                ts.forEach(commentRanges, function (c) { return c.pos < position &&
                    (c.kind == 2 /* SingleLineCommentTrivia */ ? position <= c.end : position < c.end); });
        }
        return false;
    }
1206894
function isJSDoc(commentGroup) {
            const lines = commentGroup[0].value.split(astUtils.LINEBREAK_MATCHER);

            return commentGroup[0].type === "Block" &&
                /^\*\s*$/u.test(lines[0]) &&
                lines.slice(1, -1).every(line => /^\s* /u.test(line)) &&
                /^\s*$/u.test(lines[lines.length - 1]);
        }