/* Syntax highlighting with language autodetection. http://softwaremaniacs.org/soft/highlight/ */ var hljs=new function(){var LANGUAGES={};var selected_languages={};function escape(value){return value.replace(/&/gm,'&').replace(//gm,'>')};function contains(array,item){if(!array)return false;for(var i=0;i'};function close(node){return''};while(stream1.length||stream2.length){var current=selectStream().splice(0,1)[0];result+=escape(value.substr(processed,current.offset-processed));processed=current.offset;if(current.event=='start'){result+=open(current.node);nodeStack.push(current.node)}else if(current.event=='stop'){var i=nodeStack.length;do{i--;var node=nodeStack[i];result+=close(node)}while(node!=current.node);nodeStack.splice(i,1);while(i'+escape(match[0])+''}else{result+=escape(match[0])};last_index=mode.lexemsRe.lastIndex;match=mode.lexemsRe.exec(buffer)};result+=escape(buffer.substr(last_index,buffer.length-last_index));return result};function processBuffer(buffer,mode){if(mode.subLanguage&&selected_languages[mode.subLanguage]){var result=highlight(mode.subLanguage,buffer);keyword_count+=result.keyword_count;relevance+=result.relevance;return result.value}else{return processKeywords(buffer,mode)}};function startNewMode(mode,lexem){var markup=mode.noMarkup?'':'';if(mode.returnBegin){result+=markup;mode.buffer=''}else if(mode.excludeBegin){result+=escape(lexem)+markup;mode.buffer=''}else{result+=markup;mode.buffer=lexem};modes[modes.length]=mode};function processModeInfo(buffer,lexem,end){var current_mode=modes[modes.length-1];if(end){result+=processBuffer(current_mode.buffer+buffer,current_mode);return false};var new_mode=subMode(lexem,current_mode);if(new_mode){result+=processBuffer(current_mode.buffer+buffer,current_mode);startNewMode(new_mode,lexem);relevance+=new_mode.relevance;return new_mode.returnBegin};var end_level=endOfMode(modes.length-1,lexem);if(end_level){var markup=current_mode.noMarkup?'':'';if(current_mode.returnEnd){result+=processBuffer(current_mode.buffer+buffer,current_mode)+markup}else if(current_mode.excludeEnd){result+=processBuffer(current_mode.buffer+buffer,current_mode)+markup+escape(lexem)}else{result+=processBuffer(current_mode.buffer+buffer+lexem,current_mode)+markup};while(end_level>1){markup=modes[modes.length-2].noMarkup?'':'';result+=markup;end_level--;modes.length--};modes.length--;modes[modes.length-1].buffer='';if(current_mode.starts){for(var i=0;i1)throw'Illegal';return{relevance:relevance,keyword_count:keyword_count,value:result}}catch(e){if(e=='Illegal'){return{relevance:0,keyword_count:0,value:escape(value)}}else{throw e;}}};function compileModes(){for(var i in LANGUAGES){if(!LANGUAGES.hasOwnProperty(i))continue;var language=LANGUAGES[i];for(var j=0;jmax_relevance){max_relevance=relevance;var result=lang_result.value;language=key}}};if(result){var class_name=block.className;if(!class_name.match(language)){class_name+=' '+language};var original=nodeStream(block);if(original.length){var pre=document.createElement('pre');pre.innerHTML=result;result=mergeStreams(original,nodeStream(pre),text)};if(tabReplace){result=result.replace(/^((<[^>]+>|\t)+)/gm,function(match,p1,offset,s){return p1.replace(/\t/g,tabReplace)})};var container=document.createElement('div');container.innerHTML='
'+result+'
';var environment=block.parentNode.parentNode;environment.replaceChild(container.firstChild,block.parentNode)}};function initHighlighting(){if(initHighlighting.called)return;initHighlighting.called=true;initialize();if(arguments.length){for(var i=0;i|>=|>>|>>=|>>>|>>>=|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~';this.APOS_STRING_MODE={className:'string',begin:'\'',end:'\'',illegal:'\\n',contains:['escape'],relevance:0};this.QUOTE_STRING_MODE={className:'string',begin:'"',end:'"',illegal:'\\n',contains:['escape'],relevance:0};this.BACKSLASH_ESCAPE={className:'escape',begin:'\\\\.',end:'^',noMarkup:true,relevance:0};this.C_LINE_COMMENT_MODE={className:'comment',begin:'//',end:'$',relevance:0};this.C_BLOCK_COMMENT_MODE={className:'comment',begin:'/\\*',end:'\\*/'};this.HASH_COMMENT_MODE={className:'comment',begin:'#',end:'$'};this.C_NUMBER_MODE={className:'number',begin:this.C_NUMBER_RE,end:'^',relevance:0}}();var initHighlightingOnLoad=hljs.initHighlightingOnLoad;