var tokenizeJavaScript=function(){function g(f,g,h,i){function p(b){var c=a(h,b);i(c?b:null);return{type:"string",style:"js-string"}}function o(){h.nextWhileMatches(c);return{type:"operator",style:"js-operator"}}function n(a){var b="/*",c=a=="*";for(;;){if(h.endOfLine())break;var d=h.next();if(d=="/"&&c){b=null;break}c=d=="*"}i(b);return{type:"comment",style:"js-comment"}}function m(){a(h,"/"),h.nextWhileMatches(/[gimy]/);return{type:"regexp",style:"js-string"}}function l(){h.nextWhileMatches(e);var a=h.get(),c=b.hasOwnProperty(a)&&b.propertyIsEnumerable(a)&&b[a];return c?{type:c.type,style:c.style,content:a}:{type:"variable",style:"js-variable",content:a}}function k(){h.nextWhileMatches(/[0-9]/),h.equals(".")&&(h.next(),h.nextWhileMatches(/[0-9]/));if(h.equals("e")||h.equals("E"))h.next(),h.equals("-")&&h.next(),h.nextWhileMatches(/[0-9]/);return{type:"number",style:"js-atom"}}function j(){h.next(),h.nextWhileMatches(d);return{type:"number",style:"js-atom"}}if(f=='"'||f=="'")return p(f);var q=h.next();if(f=="/*")return n(q);if(q=='"'||q=="'")return p(q);if(/[\[\]{}\(\),;\:\.]/.test(q))return{type:q,style:"js-punctuation"};if(q=="0"&&(h.equals("x")||h.equals("X")))return j();if(/[0-9]/.test(q))return k();if(q=="/"){if(h.equals("*")){h.next();return n(q)}if(h.equals("/")){a(h,null);return{type:"comment",style:"js-comment"}}return g?m():o()}return c.test(q)?o():l()}function f(a,b){return function(c,d){var e=a,h=g(a,b,c,function(a){e=a}),i=h.type=="operator"||h.type=="keyword c"||h.type.match(/^[\[{}\(,;:]$/);(i!=b||e!=a)&&d(f(e,i));return h}}function a(a,b){var c=!1;while(!a.endOfLine()){var d=a.next();if(d==b&&!c)return!1;c=!c&&d=="\\"}return c}var b=function(){function a(a,b){return{type:a,style:"js-"+b}}var b=a("keyword a","keyword"),c=a("keyword b","keyword"),d=a("keyword c","keyword"),e=a("operator","keyword"),f=a("atom","atom");return{"if":b,"while":b,"with":b,"else":c,"do":c,"try":c,"finally":c,"return":d,"break":d,"continue":d,"new":d,"delete":d,"throw":d,"in":e,"typeof":e,"instanceof":e,"var":a("var","keyword"),"function":a("function","keyword"),"catch":a("catch","keyword"),"for":a("for","keyword"),"switch":a("switch","keyword"),"case":a("case","keyword"),"default":a("default","keyword"),"true":f,"false":f,"null":f,"undefined":f,NaN:f,Infinity:f}}(),c=/[+\-*&%=<>!?|]/,d=/[0-9A-Fa-f]/,e=/[\w\$_]/;return function(a,b){return tokenizer(a,b||f(!1,!0))}}()