bower_components/prism/plugins/autoloader/prism-autoloader.js
function (lang, success, error) {
		var load = function () {
			var force = false;
			// Do we want to force reload the grammar?
			if (lang.indexOf('!') >= 0) {
				force = true;
				lang = lang.replace('!', '');
			}

			var data = lang_data[lang];
			if (!data) {
				data = lang_data[lang] = {};
			}
			if (success) {
				if (!data.success_callbacks) {
					data.success_callbacks = [];
				}
				data.success_callbacks.push(success);
			}
			if (error) {
				if (!data.error_callbacks) {
					data.error_callbacks = [];
				}
				data.error_callbacks.push(error);
			}

			if (!force && Prism.languages[lang]) {
				languageSuccess(lang);
			} else if (!force && data.error) {
				languageError(lang);
			} else if (force || !data.loading) {
				data.loading = true;
				var src = getLanguagePath(lang);
				script(src, function () {
					data.loading = false;
					languageSuccess(lang);

				}, function () {
					data.loading = false;
					data.error = true;
					languageError(lang);
				});
			}
		};
		var dependencies = lang_dependencies[lang];
		if(dependencies && dependencies.length) {
			loadLanguages(dependencies, load);
		} else {
			load();
		}
	}
function (lang, success, error) {
		var load = function () {
			var force = false;
			// Do we want to force reload the grammar?
			if (lang.indexOf('!') >= 0) {
				force = true;
				lang = lang.replace('!', '');
			}

			var data = lang_data[lang];
			if (!data) {
				data = lang_data[lang] = {};
			}
			if (success) {
				if (!data.success_callbacks) {
					data.success_callbacks = [];
				}
				data.success_callbacks.push(success);
			}
			if (error) {
				if (!data.error_callbacks) {
					data.error_callbacks = [];
				}
				data.error_callbacks.push(error);
			}

			if (!force && Prism.languages[lang]) {
				languageSuccess(lang);
			} else if (!force && data.error) {
				languageError(lang);
			} else if (force || !data.loading) {
				data.loading = true;
				var src = getLanguagePath(lang);
				script(src, function () {
					data.loading = false;
					languageSuccess(lang);

				}, function () {
					data.loading = false;
					data.error = true;
					languageError(lang);
				});
			}
		};
		var dependencies = lang_dependencies[lang];
		if(dependencies && dependencies.length) {
			loadLanguages(dependencies, load);
		} else {
			load();
		}
	}
function ( lang , success , error ) { var load = function ( ) { var force = false ; // Do we want to force reload the grammar? if ( lang . indexOf ( '!' ) >= 0 ) { force = true ; lang = lang . replace ( '!' , '' ) ; } var data = lang_data [ lang ] ; if ( ! data ) { data = lang_data [ lang ] = { } ; } if ( success ) { if ( ! data . success_callbacks ) { data . success_callbacks = [ ] ; } data . success_callbacks . push ( success ) ; } if ( error ) { if ( ! data . error_callbacks ) { data . error_callbacks = [ ] ; } data . error_callbacks . push ( error ) ; } if ( ! force && Prism . languages [ lang ] ) { languageSuccess ( lang ) ; } else if ( ! force && data . error ) { languageError ( lang ) ; } else if ( force || ! data . loading ) { data . loading = true ; var src = getLanguagePath ( lang ) ; script ( src , function ( ) { data . loading = false ; languageSuccess ( lang ) ; } , function ( ) { data . loading = false ; data . error = true ; languageError ( lang ) ; } ) ; } } ; var dependencies = lang_dependencies [ lang ] ; if ( dependencies && dependencies . length ) { loadLanguages ( dependencies , load ) ; } else { load ( ) ; } }
Load a grammar with its dependencies
@param {string} lang
@param {function=} success
@param {function=} error
Load a grammar with its dependencies