comment = "(" *([FWS] ccontent) [FWS] ")"
       ccontent = ctext / quoted-pair / comment

    We handle nested comments here, and quoted-pair in our qp-ctext routine.
490974
def get_comment(value):
    
    if value and value[0] != '(':
        raise errors.HeaderParseError(
            "expected '(' but found '{}'".format(value))
    comment = Comment()
    value = value[1:]
    while value and value[0] != ")":
        if value[0] in WSP:
            token, value = get_fws(value)
        elif value[0] == '(':
            token, value = get_comment(value)
        else:
            token, value = get_qp_ctext(value)
        comment.append(token)
    if not value:
        comment.defects.append(errors.InvalidHeaderDefect(
            "end of header inside comment"))
        return comment, value
    return comment, value[1:]
312270
def set_quoted_text(self, quoted_text):
        """"""
        self.quoted_text = quoted_text
        self.line_comment = False
        return self
546445
def parse(self, ctx, ref, text):
        

        self.ctx = ctx
        self.pos = error.Position(ref)
        self.top = None
        try:
            self.tokenizer = YangTokenizer(text, self.pos, ctx.errors,
                                           ctx.max_line_len, ctx.keep_comments,
                                           not ctx.lax_quote_checks)
            stmt = self._parse_statement(None)
        except error.Abort:
            return None
        except error.Eof as e:
            error.err_add(self.ctx.errors, self.pos, 'EOF_ERROR', ())
            return None
        try:
            # we expect a error.Eof at this point, everything else is an error
            self.tokenizer.peek()
        except error.Eof:
            return stmt
        except:
            pass
        error.err_add(self.ctx.errors, self.pos, 'TRAILING_GARBAGE', ())
        return None
622896
function isCommentLine (line) {
  var isCmnt = commentRE.test(line);
  if (isCmnt) {
    debug('removing comment: %s', line);
  }
  return !isCmnt;
}
1224112
Comment comment() {
        if (comment == null) {
            String d = documentation();
            if (env.javaScriptScanner != null) {
                env.javaScriptScanner.parse(d, new JavaScriptScanner.Reporter() {
                    @Override
                    public void report() {
                        env.error(DocImpl.this, "javadoc.JavaScript_in_comment");
                        throw new FatalError();
                    }
                });
            }
            if (env.doclint != null
                    && treePath != null
                    && env.shouldCheck(treePath.getCompilationUnit())
                    && d.equals(getCommentText(treePath))) {
                env.doclint.scan(treePath);
            }
            comment = new Comment(this, d);
        }
        return comment;
    }
791226
function tokenComment(stream, state) {
    var maybeEnd = false, maybeNested = false, nestedCount = 0, ch;
    while (ch = stream.next()) {
      if (ch == ")" && maybeEnd) {
        if(nestedCount > 0)
          nestedCount--;
        else {
          popStateStack(state);
          break;
        }
      }
      else if(ch == ":" && maybeNested) {
        nestedCount++;
      }
      maybeEnd = (ch == ":");
      maybeNested = (ch == "(");
    }
    
    return ret("comment", "comment");
  }
351775
function commentToken(label, body, opt) {
      var special = ["jshint", "jslint", "members", "member", "globals", "global", "exported"];
      var isSpecial = false;
      var value = label + body;
      var commentType = "plain";
      opt = opt || {};

      if (opt.isMultiline) {
        value += "*/";
      }

      special.forEach(function (str) {
        if (isSpecial) {
          return;
        }

        // Don't recognize any special comments other than jshint for single-line
        // comments. This introduced many problems with legit comments.
        if (label === "//" && str !== "jshint") {
          return;
        }

        if (body.substr(0, str.length) === str) {
          isSpecial = true;
          label = label + str;
          body = body.substr(str.length);
        }

        if (!isSpecial && body.charAt(0) === " " && body.substr(1, str.length) === str) {
          isSpecial = true;
          label = label + " " + str;
          body = body.substr(str.length + 1);
        }

        if (!isSpecial) {
          return;
        }

        switch (str) {
        case "member":
          commentType = "members";
          break;
        case "global":
          commentType = "globals";
          break;
        default:
          commentType = str;
        }
      });

      return {
        type: Token.Comment,
        commentType: commentType,
        value: value,
        body: body,
        isSpecial: isSpecial,
        isMultiline: opt.isMultiline || false,
        isMalformed: opt.isMalformed || false
      };
    }
1208389
function processLine (context, comment) {
  const parsed = parse(COMMENT_DIRECTIVE_L, comment.value)
  if (parsed != null && comment.loc.start.line === comment.loc.end.line) {
    const line = comment.loc.start.line + (parsed.type === 'eslint-disable-line' ? 0 : 1)
    const column = -1
    disable(context, { line, column }, 'line', parsed.rules)
    enable(context, { line: line + 1, column }, 'line', parsed.rules)
  }
}
632994
def _parse_comment_trail(self):  # type: () -> Tuple[str, str, str]
        
        if self.end():
            return "", "", ""

        comment = ""
        comment_ws = ""
        self.mark()

        while True:
            c = self._current

            if c == "\n":
                break
            elif c == "#":
                comment_ws = self.extract()

                self.mark()
                self.inc()  # Skip #

                # The comment itself
                while not self.end() and not self._current.is_nl() and self.inc():
                    pass

                comment = self.extract()
                self.mark()

                break
            elif c in " \t\r":
                self.inc()
            else:
                raise self.parse_error(UnexpectedCharError, c)

            if self.end():
                break

        while self._current.is_spaces() and self.inc():
            pass

        if self._current == "\r":
            self.inc()

        if self._current == "\n":
            self.inc()

        trail = ""
        if self._idx != self._marker or self._current.is_ws():
            trail = self.extract()

        return comment_ws, comment, trail
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;
    }
926629
def read_comment(self, start: int, line: int, col: int, prev: Token) -> Token:
        """"""
        body = self.source.body
        body_length = len(body)

        position = start
        while True:
            position += 1
            if position > body_length:
                break
            char = body[position]
            if char < " " and char != "\t":
                break
        return Token(
            TokenKind.COMMENT,
            start,
            position,
            line,
            col,
            prev,
            body[start + 1 : position],
        )
1240743
function commentContainsWarningTerm(comment) {
            const matches = []

            warningRegExps.forEach((regex, index) => {
                if (regex.test(comment)) {
                    matches.push(warningTerms[index])
                }
            })

            return matches
        }
591846
function checkComment(node) {
            if (astUtils.isDirectiveComment(node) && selfConfigRegEx.test(node.value)) {
                return;
            }

            const matches = commentContainsWarningTerm(node.value);

            matches.forEach(matchedTerm => {
                context.report({
                    node,
                    message: "Unexpected '{{matchedTerm}}' comment.",
                    data: {
                        matchedTerm
                    }
                });
            });
        }
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 };
}
370943
private Ctx findContext( String text ) {

		// Are we inside a comment?
		Ctx ctx = new Ctx();
		int n;
		for( n = text.length() - 1; n >= 0; n-- ) {
			char c = text.charAt( n );
			if( isLineBreak( c ))
				break;

			if( c == '#' ) {
				ctx.kind = CtxKind.COMMENT;
				return ctx;
			}
		}

		// Simplify the search: remove all the comments.
		text = TextUtils.removeComments( text );

		// Keep on simplifying the search: remove complete instances
		// Since instances can contain other instances (recursivity), we must
		// apply the pattern several times, until no more replacement is possible.
		int before = -1;
		int after = -2;
		while( before != after ) {
			before = text.length();
			text = text.replaceAll( "(?i)(?s)instance\\s+of[^{]*\\{[^{}]*\\}", "" );
			after = text.length();
		}

		// Remove white spaces at the beginning of the string.
		text = text.replaceAll( "^(\n|\r\n)+", "" );

		// Now, find our context.
		String lastWord = null, lastLine = null;
		StringBuilder sb = new StringBuilder();

		for( n = text.length() - 1; n >= 0 && ctx.kind == CtxKind.NEUTRAL; n-- ) {
			char c = text.charAt( n );

			// After a "colon" => we are in a property, forget it...
			if( c == ':' && lastWord != null ) {
				ctx.kind = CtxKind.ATTRIBUTE_VALUE;
				break;
			}

			// White space? We have a our last word.
			if( Character.isWhitespace( c ) && lastWord == null )
				lastWord = sb.toString();

			// Store the last line.
			if( isLineBreak( c ) && lastLine == null )
				lastLine = sb.toString();

			// After a semicolon: we should suggest new attributes
			if( c == ';' )
				ctx.kind = CtxKind.ATTRIBUTE;

			// Same thing after a curly bracket
			else if( c == '{' )
				ctx.kind = CtxKind.ATTRIBUTE;

			else {
				sb.insert( 0, c );
				String cmp = sb.toString();
				if( lastWord != null )
					cmp = cmp.substring( 0, cmp.length() - lastWord.length());

				cmp = cmp.trim().replaceAll( "\\s{2,}", " " );
				if( cmp.equals( KEYWORD_INSTANCE_OF ))
					ctx.kind = CtxKind.COMPONENT_NAME;

				else if( cmp.equals( KEYWORD_IMPORT )
						&& ! sb.toString().matches( ".*" + KEYWORD_IMPORT ))
					ctx.kind = CtxKind.IMPORT;
			}
		}

		// Update the context
		ctx.lastWord = lastWord == null ? sb.toString() : lastWord;

		// If we are in the attribute state, we should verify the last line.
		// Case "instance of C " would otherwise indicate
		if( lastLine == null )
			lastLine = sb.toString();

		if( lastLine.matches( "(?i).*\\binstance\\s+of\\s+\\S+\\s+" )) {
			ctx.kind = CtxKind.NOTHING;
		}

		// Find the parent instance (which is the first declared instance at the end of 'text').
		Pattern p = Pattern.compile( "(?i)([\\t ]*)instance\\s+of\\s+([^{]+)", Pattern.CASE_INSENSITIVE );
		Matcher m = p.matcher( text );
		while( m.find()) {
			// instance of t| => 'lastWord == t' and 'm.group( 2 ) == t''
			// instance of => 'lastWord' is not relevant...
			if( ! Objects.equals( ctx.lastWord, m.group( 2 ).trim())) {
				ctx.parentIndentation = m.group( 1 );
				ctx.parentIndentation += "\t";
				ctx.parentInstanceType = m.group( 2 ).trim();
			}
		}

		return ctx;
	}
1136606
private static boolean isTargetComment(final String comment) {
		return comment != null
				&& comment.length() > 0
				&& (Character.isJavaIdentifierStart(comment.charAt(0)) || '#' == comment.charAt(0) || '(' == comment
						.charAt(0));
	}
671312
def comments(self, text, start=0):
        

        out = [self.extractChunkContent(s)
               for s in self.chunkComment(text, start)]
        return out