components/prism-javadoclike.js
function docCommentSupport(lang, callback) {
		var tokenName = 'doc-comment';

		var grammar = Prism.languages[lang];
		if (!grammar) {
			return;
		}
		var token = grammar[tokenName];

		if (!token) {
			// add doc comment: /** */
			var definition = {};
			definition[tokenName] = {
				pattern: /(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,
				alias: 'comment'
			};

			grammar = Prism.languages.insertBefore(lang, 'comment', definition);
			token = grammar[tokenName];
		}

		if (token instanceof RegExp) { // convert regex to object
			token = grammar[tokenName] = { pattern: token };
		}

		if (Array.isArray(token)) {
			for (var i = 0, l = token.length; i < l; i++) {
				if (token[i] instanceof RegExp) {
					token[i] = { pattern: token[i] };
				}
				callback(token[i]);
			}
		} else {
			callback(token);
		}
	}
function docCommentSupport(lang, callback) {
		var tokenName = 'doc-comment';

		var grammar = Prism.languages[lang];
		if (!grammar) {
			return;
		}
		var token = grammar[tokenName];

		if (!token) {
			// add doc comment: /** */
			var definition = {};
			definition[tokenName] = {
				pattern: /(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,
				alias: 'comment'
			};

			grammar = Prism.languages.insertBefore(lang, 'comment', definition);
			token = grammar[tokenName];
		}

		if (token instanceof RegExp) { // convert regex to object
			token = grammar[tokenName] = { pattern: token };
		}

		if (Array.isArray(token)) {
			for (var i = 0, l = token.length; i < l; i++) {
				if (token[i] instanceof RegExp) {
					token[i] = { pattern: token[i] };
				}
				callback(token[i]);
			}
		} else {
			callback(token);
		}
	}
function docCommentSupport ( lang , callback ) { var tokenName = 'doc-comment' ; var grammar = Prism . languages [ lang ] ; if ( ! grammar ) { return ; } var token = grammar [ tokenName ] ; if ( ! token ) { // add doc comment: /** */ var definition = { } ; definition [ tokenName ] = { pattern : / (^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$) / , alias : 'comment' } ; grammar = Prism . languages . insertBefore ( lang , 'comment' , definition ) ; token = grammar [ tokenName ] ; } if ( token instanceof RegExp ) { // convert regex to object token = grammar [ tokenName ] = { pattern : token } ; } if ( Array . isArray ( token ) ) { for ( var i = 0 , l = token . length ; i < l ; i ++ ) { if ( token [ i ] instanceof RegExp ) { token [ i ] = { pattern : token [ i ] } ; } callback ( token [ i ] ) ; } } else { callback ( token ) ; } }
Adds doc comment support to the given language and calls a given callback on each doc comment pattern.

@param {string} lang the language add doc comment support to.
@param {(pattern: {inside: {rest: undefined}}) => void} callback the function called with each doc comment pattern as argument.
Adds doc comment support to the given language and calls a given callback on each doc comment pattern .