Because we take the comment as JavaScript source code, it can reference variables and do all sorts of crazy stuff.
976915
function parseComment (comment) {
  const body = j('[' + comment + ']').nodes()[0].program.body
  const array = body[0].expression
  return array.elements
}
1278791
def comment(string, options = {})
      options = {
        :style => :css,
        :per_line => true
      }.update(options)
      
      commenters = {
        :html => Proc.new{|s| "<!-- #{s} -->" },
        :css => Proc.new{|s| "/*! #{s} */" },
        :js => Proc.new{|s| "/*! #{s} */" }                
      }
      
      commenter = commenters[options[:style]] || commenters[:js]
      
      if options[:per_line]
        string = string.split(/\r?\n/)
        string.map{|s| commenter.call(s) }.join("\n")
      else
        commenter.call(s)
      end
    end
171130
function addComment(form) {
    var node_id = form.find('input[name="node"]').val();
    var parent_id = form.find('input[name="parent"]').val();
    var text = form.find('textarea[name="comment"]').val();
    var proposal = form.find('textarea[name="proposal"]').val();

    if (text == '') {
      showError('Please enter a comment.');
      return;
    }

    // Disable the form that is being submitted.
    form.find('textarea,input').attr('disabled', 'disabled');

    // Send the comment to the server.
    $.ajax({
      type: "POST",
      url: opts.addCommentURL,
      dataType: 'json',
      data: {
        node: node_id,
        parent: parent_id,
        text: text,
        proposal: proposal
      },
      success: function(data, textStatus, error) {
        // Reset the form.
        if (node_id) {
          hideProposeChange(node_id);
        }
        form.find('textarea')
          .val('')
          .add(form.find('input'))
          .removeAttr('disabled');
	var ul = $('#cl' + (node_id || parent_id));
        if (ul.data('empty')) {
          $(ul).empty();
          ul.data('empty', false);
        }
        insertComment(data.comment);
        var ao = $('#ao' + node_id);
        ao.find('img').attr({'src': opts.commentBrightImage});
        if (node_id) {
          // if this was a "root" comment, remove the commenting box
          // (the user can get it back by reopening the comment popup)
          $('#ca' + node_id).slideUp();
        }
      },
      error: function(request, textStatus, error) {
        form.find('textarea,input').removeAttr('disabled');
        showError('Oops, there was a problem adding the comment.');
      }
    });
  }
630081
function ( code ) {
		var text = code.firstChild;
		if ( text ) {
			text.data = text.data.substring ( 1 ); // we inserted a #
		}
	}
982863
function commentStrip(string) {
  // Remove commented lines
  string = string.replace(RE_COMMENT_SINGLE_LINE, '');
  string = string.replace(RE_COMMENT_MULTI_LINES, '');
  return string;
}
601695
function addComment( text, multiline ) {

          if ( options.extractComments ) {

              const loc = location();

              comments[ loc.start.offset ] = {
                  text: text,
                  multiline: multiline,
                  location: loc,
              };

          }

          return text;

      }
668352
def mangle_comment(comment)
      comment.sub!(%r{/\*+}) { " " * $&.length }
      comment.sub!(%r{\*+/}) { " " * $&.length }
      comment.gsub!(/^[ \t]*\*/m) { " " * $&.length }
      comment
    end
754068
public final void mSTATEMENT_COMMENT() throws RecognitionException {
        try {
            int _type = STATEMENT_COMMENT;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // BELScript.g:257:18: ( '//' ( ( '\\\\\\n' ) | ( '\\\\\\r\\n' ) | ~ ( '\\n' | '\\r' ) )* )
            // BELScript.g:258:5: '//' ( ( '\\\\\\n' ) | ( '\\\\\\r\\n' ) | ~ ( '\\n' | '\\r' ) )*
            {
            match("//"); 

            // BELScript.g:258:10: ( ( '\\\\\\n' ) | ( '\\\\\\r\\n' ) | ~ ( '\\n' | '\\r' ) )*
            loop2:
            do {
                int alt2=4;
                int LA2_0 = input.LA(1);

                if ( (LA2_0=='\\') ) {
                    switch ( input.LA(2) ) {
                    case '\n':
                        {
                        alt2=1;
                        }
                        break;
                    case '\r':
                        {
                        alt2=2;
                        }
                        break;

                    default:
                        alt2=3;
                        break;
                    }

                }
                else if ( ((LA2_0>='\u0000' && LA2_0<='\t')||(LA2_0>='\u000B' && LA2_0<='\f')||(LA2_0>='\u000E' && LA2_0<='[')||(LA2_0>=']' && LA2_0<='\uFFFF')) ) {
                    alt2=3;
                }


                switch (alt2) {
            	case 1 :
            	    // BELScript.g:258:11: ( '\\\\\\n' )
            	    {
            	    // BELScript.g:258:11: ( '\\\\\\n' )
            	    // BELScript.g:258:12: '\\\\\\n'
            	    {
            	    match("\\\n"); 


            	    }


            	    }
            	    break;
            	case 2 :
            	    // BELScript.g:258:22: ( '\\\\\\r\\n' )
            	    {
            	    // BELScript.g:258:22: ( '\\\\\\r\\n' )
            	    // BELScript.g:258:23: '\\\\\\r\\n'
            	    {
            	    match("\\\r\n"); 


            	    }


            	    }
            	    break;
            	case 3 :
            	    // BELScript.g:258:35: ~ ( '\\n' | '\\r' )
            	    {
            	    if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\uFFFF') ) {
            	        input.consume();

            	    }
            	    else {
            	        MismatchedSetException mse = new MismatchedSetException(null,input);
            	        recover(mse);
            	        throw mse;}


            	    }
            	    break;

            	default :
            	    break loop2;
                }
            } while (true);


            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
635492
function emitTrailingCommentsOfPosition(pos) {
                if (compilerOptions.removeComments) {
                    return;
                }
                var trailingComments = ts.getTrailingCommentRanges(currentText, pos);
                // trailing comments are emitted at space/*trailing comment1 */space/*trailing comment*/
                ts.emitComments(currentText, currentLineMap, writer, trailingComments, /*trailingSeparator*/ true, newLine, writeComment);
            }
1192660
function findRequireComments(source, source_path, options, deps) {
  var comment_reg = /{! require\("([\w\.\/\-_\|[\]]+)\"\) !}/g, // matches proprietary comment syntax for requiring multiple partials
    bracket_reg = /\[([^\]]*)\]/g,                            // matches brackets inside the comment requiring
    result = null, bracket_result = null, alt, name;

  // search source for require comments
  while ((result = comment_reg.exec(source)) !== null) {
    // this will check if there are any comments that have a | delimited list of files, such as {! require("patterns/atoms/[button|button_link]") !}
    bracket_result = bracket_reg.exec(result[1]);

    // if there is a result, split the files by | and include them all
    if (bracket_result) {
      alt = bracket_result[1].split("|");
      for (var i = 0; i < alt.length; i++) {
        name = result[1].replace(bracket_reg, alt[i]);
        log(options, 'found comment dependency "' + name + '"');

        // add a dust dependency for each alternative name
        addDustDependency(name, source_path, options, deps);
      }
    }
    //if there isn't a result, assume it was just a normal require like {! require("patterns/atoms/button") !}
    else {
      log(options, 'found comment dependency "' + result[1] + '"');
      addDustDependency(result[1], source_path, options, deps);
    }
  }
}
246475
function CommentsGrammar(myna)  
{
    // Setup a shorthand for the Myna parsing library object
    let m = myna;    

    this.ws = m.space.or(m.tab).zeroOrMore; 
    this.newLine = this.newLine.copy.ast;
    this.lineCommentContents = m.advanceWhileNot(this.newLine).ast;
    this.lineComment = m.seq("//", m.zeroOrMore("/").ws, this.lineCommentContents, this.newLine);
    this.lineComments = this.lineComment.oneOrMore.ast;

    this.blockCommentLineContents = m.advanceWhileNot(m.choice("*/"), this.newLine).ast;
    this.blockCommentLine = m.seq(this.ws, m.star("*").ws, this.blockCommentLineComments); 
    this.blockComment = m.seq("/*", this.blockCommentLine.then(this.newLine).zeroOrMore, "*/").ast;

    this.code = m.seq(m.advanceWhileNot(m.or(this.newLine, m.blockComment, m.lineComment))).ast;
    this.element = m.choice(this.ws, this.code, this.blockComment, this.lineComment, this.newLine);

    this.file = this.element.star; 
}
41816
function(text) {
    let el = stack.peek();
    if (el && el.type === types.COMMENT) {
      stack.createObject(text);
      stack.closeElement(el);
    } else {
      stack.createComment(text);
    }
  }
601838
function withComment (example, comment) {
  const constructor = example == null ? null : example.constructor;

  if (constructor === Object || constructor === Array) {
    Object.defineProperty(example, '_comment', {
      value: comment,
      enumerable: false
    });

    return example;
  }

  // Convert primitives
  return new PrimitiveWithComment(example, comment);
}
674581
function generateDoc (name, code) {
  // get block comment from code
  const match = /\/\*\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\//.exec(code)

  if (!match) {
    return null
  }

  // get text content inside block comment
  const comment = match[0].replace('/**', '')
    .replace('*/', '')
    .replace(/\n\s*\* ?/g, '\n')
    .replace(/\r/g, '')

  const lines = comment.split('\n')
  let line = ''

  // get next line
  function next () {
    line = lines.shift()
  }

  // returns true if current line is empty
  function empty () {
    return !line || !line.trim()
  }

  // returns true if there still is a current line
  function exists () {
    return line !== undefined
  }

  // returns true if current line is a header like 'Syntax:'
  function isHeader () {
    return /^(Name|Syntax|Description|Examples|See also)/i.test(line)
  }

  // returns true if the current line starts with an annotation like @param
  function isAnnotation () {
    return /^@/.test(line)
  }

  function skipEmptyLines () {
    while (exists() && empty()) next()
  }

  function stripLeadingSpaces (lines) {
    let spaces = null
    lines.forEach(function (line) {
      const match = /^ +/.exec(line)
      const s = match && match[0] && match[0].length
      if (s > 0 && (spaces === null || s < spaces)) {
        spaces = s
      }
    })

    if (spaces) {
      lines.forEach(function (line, index) {
        lines[index] = line.substring(spaces)
      })
    }
  }

  function parseDescription () {
    let description = ''

    while (exists() && !isHeader() && !isAnnotation()) {
      description += line + '\n'

      next()
    }

    // remove trailing returns
    while (description.charAt(description.length - 1) === '\n') {
      description = description.substring(0, description.length - 1)
    }

    doc.description = description
  }

  function parseSyntax () {
    if (/^syntax/i.test(line)) {
      next()
      skipEmptyLines()

      while (exists() && !empty()) {
        doc.syntax.push(line)
        next()
      }
      stripLeadingSpaces(doc.syntax)

      skipEmptyLines()

      return true
    }
    return false
  }

  function parseWhere () {
    if (/^where/i.test(line)) {
      next()
      skipEmptyLines()

      while (exists() && !empty()) {
        doc.where.push(line)
        next()
      }

      skipEmptyLines()

      return true
    }
    return false
  }

  function parseExamples () {
    if (/^example/i.test(line)) {
      next()
      skipEmptyLines()

      while (exists() && (empty() || line.charAt(0) === ' ')) {
        doc.examples.push(line)
        next()
      }
      stripLeadingSpaces(doc.examples)

      if (doc.examples.length > 0 && doc.examples[doc.examples.length - 1].trim() === '') {
        doc.examples.pop()
      }

      skipEmptyLines()

      return true
    }
    return false
  }

  function parseSeeAlso () {
    if (/^see also/i.test(line)) {
      next()
      skipEmptyLines()

      while (exists() && !empty()) {
        const names = line.split(',')
        doc.seeAlso = doc.seeAlso.concat(names.map(function (name) {
          return name.trim()
        }))
        next()
      }

      skipEmptyLines()

      return true
    }
    return false
  }

  function trim (text) {
    return text.trim()
  }

  // replace characters like '<' with HTML entities like '&lt;'
  function escapeTags (text) {
    return text.replace(/</g, '&lt;').replace(/>/g, '&gt;')
  }

  function parseParameters () {
    let count = 0
    let match
    do {
      match = /\s*@param\s*\{(.*)}\s*\[?(\w*)]?\s*(.*)?$/.exec(line)
      if (match) {
        next()

        count++
        const annotation = {
          name: match[2] || '',
          description: (match[3] || '').trim(),
          types: match[1].split('|').map(trim).map(escapeTags)
        }
        doc.parameters.push(annotation)

        // TODO: this is an ugly hack to extract the default value
        const index = annotation.description.indexOf(']')
        let defaultValue = null
        if (index !== -1) {
          defaultValue = annotation.description.substring(1, index).trim()
          annotation.description = annotation.description.substring(index + 1).trim()
        }

        // multi line description (must be non-empty and not start with @param or @return)
        while (exists() && !empty() && !/^\s*@/.test(line)) {
          const lineTrim = line.trim()
          const separator = (lineTrim[0] === '-' ? '</br>' : ' ')
          annotation.description += separator + lineTrim
          next()
        }

        if (defaultValue !== null) {
          annotation.description += ' Default value: ' + defaultValue + '.'
        }
      }
    } while (match)

    return count > 0
  }

  function parseReturns () {
    const match = /\s*@returns?\s*\{(.*)}\s*(.*)?$/.exec(line)
    if (match) {
      next()

      doc.returns = {
        description: match[2] || '',
        types: match[1].split('|').map(trim).map(escapeTags)
      }

      // multi line description
      while (exists() && !empty() && !/^\s*@/.test(line)) {
        doc.returns.description += ' ' + line.trim()
        next()
      }

      return true
    }
    return false
  }

  // initialize doc
  let doc = {
    name: name,
    description: '',
    syntax: [],
    where: [],
    examples: [],
    seeAlso: [],
    parameters: [],
    returns: null
  }

  next()
  skipEmptyLines()
  parseDescription()

  do {
    skipEmptyLines()

    const handled = parseSyntax() ||
        parseWhere() ||
        parseExamples() ||
        parseSeeAlso() ||
        parseParameters() ||
        parseReturns()

    if (!handled) {
      // skip this line, no one knows what to do with it
      next()
    }
  } while (exists())

  return doc
}
1231017
function(frame) {
    var strCss = '';
    if (frame.type === 'keyframe') {
      strCss += frame.values.join(',') + ' {';
      frame.declarations.forEach(function(declaration) {
        strCss += commentOrDeclaration(declaration);
      });
      strCss += '\n}\n\n';
    } else if (frame.type === 'comment') {
      strCss += processComment(frame) + '\n\n';
    }
    return strCss;
  }
305080
function attachCommentReply(comment) {
    return function reply(body, callback) {
        github.replyToReviewComment(this.repo.data.owner.login, this.repo.data.name, this.data.number, comment.id, body, callback);
    }.bind(this);
}
1316756
function (commentObj, code, filepath, context, emitter) {
        var tagRegexp = tags.getTagRegexp();
        var sym = new Symbol({file:filepath});
        var comment = commentObj.comment,
            match = tagRegexp.exec(comment), description,
            l = comment.length, i;
        if (match && match[1]) {
            parseCode(code, commentObj.end, sym, context);
            i = match.index;
            sym.description = comment.substr(0, i);
            comment = comment.substr(i);
            i = 0;
            while (i < l) {
                var subComment = comment.substr(i), nextIndex;
                match = tagRegexp.exec(comment.substr(i + 2));
                if (match && match[1]) {
                    nextIndex = match.index;
                    nextIndex += i + 1;
                    parseTag(comment.substr(i, nextIndex - i), sym, context);
                    i = nextIndex;
                } else {
                    parseTag(subComment, sym, context);
                    i = l;
                }
            }
        } else {
            parseCode(code, commentObj.end, sym, context);
            sym.description = comment;
        }
        sym.fullName = sym.memberof ? [sym.memberof, sym.name].join(".") : sym.name;
        return {symbol:sym, comment:comment};
    }