1(function(a){if(typeof exports=="object"&&typeof module=="object")a(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],a);else a(CodeMirror)})(function(a){"use strict";a.defineMode("julia",function(b,c){function d(a,b){if(typeof b==="undefined"){b="\\b"}return new RegExp("^(("+a.join(")|(")+"))"+b)}var e="\\\\[0-7]{1,3}";var f="\\\\x[A-Fa-f0-9]{1,2}";var g="\\\\[abefnrtv0%?'\"\\\\]";var h="([^\\u0027\\u005C\\uD800-\\uDFFF]|[\\uD800-\\uDFFF][\\uDC00-\\uDFFF])";var i=c.operators||d(["[<>]:","[<>=]=","<<=?",">>>?=?","=>","->","\\/\\/","[\\\\%*+\\-<>!=\\/^|&\\u00F7\\u22BB]=?","\\?","\\$","~",":","\\u00D7","\\u2208","\\u2209","\\u220B","\\u220C","\\u2218","\\u221A","\\u221B","\\u2229","\\u222A","\\u2260","\\u2264","\\u2265","\\u2286","\\u2288","\\u228A","\\u22C5","\\b(in|isa)\\b(?!.?\\()"],"");var j=c.delimiters||/^[;,()[\]{}]/;var k=c.identifiers||/^[_A-Za-z\u00A1-\u2217\u2219-\uFFFF][\w\u00A1-\u2217\u2219-\uFFFF]*!*/;var l=d([e,f,g,h],"'");var m=["begin","function","type","struct","immutable","let","macro","for","while","quote","if","else","elseif","try","finally","catch","do"];var n=["end","else","elseif","catch","finally"];var o=["if","else","elseif","while","for","begin","let","end","do","try","catch","finally","return","break","continue","global","local","const","export","import","importall","using","function","where","macro","module","baremodule","struct","type","mutable","immutable","quote","typealias","abstract","primitive","bitstype"];var p=["true","false","nothing","NaN","Inf"];a.registerHelper("hintWords","julia",o.concat(p));var q=d(m);var r=d(n);var s=d(o);var t=d(p);var u=/^@[_A-Za-z][\w]*/;var v=/^:[_A-Za-z\u00A1-\uFFFF][\w\u00A1-\uFFFF]*!*/;var w=/^(`|([_A-Za-z\u00A1-\uFFFF]*"("")?))/;function x(a){return a.nestedArrays>0}function y(a){return a.nestedGenerators>0}function z(a,b){if(typeof b==="undefined"){b=0}if(a.scopes.length<=b){return null}return a.scopes[a.scopes.length-(b+1)]}function A(a,b){if(a.match(/^#=/,false)){b.tokenize=D;return b.tokenize(a,b)}var c=b.leavingExpr;if(a.sol()){c=false}b.leavingExpr=false;if(c){if(a.match(/^'+/)){return"operator"}}if(a.match(/\.{4,}/)){return"error"}else if(a.match(/\.{1,3}/)){return"operator"}if(a.eatSpace()){return null}var d=a.peek();if(d==="#"){a.skipToEnd();return"comment"}if(d==="["){b.scopes.push("[");b.nestedArrays++}if(d==="("){b.scopes.push("(");b.nestedGenerators++}if(x(b)&&d==="]"){while(b.scopes.length&&z(b)!=="["){b.scopes.pop()}b.scopes.pop();b.nestedArrays--;b.leavingExpr=true}if(y(b)&&d===")"){while(b.scopes.length&&z(b)!=="("){b.scopes.pop()}b.scopes.pop();b.nestedGenerators--;b.leavingExpr=true}if(x(b)){if(b.lastToken=="end"&&a.match(/^:/)){return"operator"}if(a.match(/^end/)){return"number"}}var e;if(e=a.match(q,false)){b.scopes.push(e[0])}if(a.match(r,false)){b.scopes.pop()}if(a.match(/^::(?![:\$])/)){b.tokenize=C;return b.tokenize(a,b)}if(!c&&a.match(v)||a.match(/:([<>]:|<<=?|>>>?=?|->|\/\/|\.{2,3}|[\.\\%*+\-<>!\/^|&]=?|[~\?\$])/)){return"builtin"}if(a.match(i)){return"operator"}if(a.match(/^\.?\d/,false)){var f=RegExp(/^im\b/);var g=false;if(a.match(/^0x\.[0-9a-f_]+p[\+\-]?[_\d]+/i)){g=true}if(a.match(/^0x[0-9a-f_]+/i)){g=true}if(a.match(/^0b[01_]+/i)){g=true}if(a.match(/^0o[0-7_]+/i)){g=true}if(a.match(/^(?:(?:\d[_\d]*)?\.(?!\.)(?:\d[_\d]*)?|\d[_\d]*\.(?!\.)(?:\d[_\d]*))?([Eef][\+\-]?[_\d]+)?/i)){g=true}if(a.match(/^\d[_\d]*(e[\+\-]?\d+)?/i)){g=true}if(g){a.match(f);b.leavingExpr=true;return"number"}}if(a.match(/^'/)){b.tokenize=E;return b.tokenize(a,b)}if(a.match(w)){b.tokenize=F(a.current());return b.tokenize(a,b)}if(a.match(u)){return"meta"}if(a.match(j)){return null}if(a.match(s)){return"keyword"}if(a.match(t)){return"builtin"}var h=b.isDefinition||b.lastToken=="function"||b.lastToken=="macro"||b.lastToken=="type"||b.lastToken=="struct"||b.lastToken=="immutable";if(a.match(k)){if(h){if(a.peek()==="."){b.isDefinition=true;return"variable"}b.isDefinition=false;return"def"}if(a.match(/^({[^}]*})*\(/,false)){b.tokenize=B;return b.tokenize(a,b)}b.leavingExpr=true;return"variable"}a.next();return"error"}function B(a,b){var c=a.match(/^(\(\s*)/);if(c){if(b.firstParenPos<0)b.firstParenPos=b.scopes.length;b.scopes.push("(");b.charsAdvanced+=c[1].length}if(z(b)=="("&&a.match(/^\)/)){b.scopes.pop();b.charsAdvanced+=1;if(b.scopes.length<=b.firstParenPos){var d=a.match(/^(\s*where\s+[^\s=]+)*\s*?=(?!=)/,false);a.backUp(b.charsAdvanced);b.firstParenPos=-1;b.charsAdvanced=0;b.tokenize=A;if(d)return"def";return"builtin"}}if(a.match(/^$/g,false)){a.backUp(b.charsAdvanced);while(b.scopes.length>b.firstParenPos)b.scopes.pop();b.firstParenPos=-1;b.charsAdvanced=0;b.tokenize=A;return"builtin"}b.charsAdvanced+=a.match(/^([^()]*)/)[1].length;return b.tokenize(a,b)}function C(a,b){a.match(/.*?(?=,|;|{|}|\(|\)|=|$|\s)/);if(a.match(/^{/)){b.nestedParameters++}else if(a.match(/^}/)&&b.nestedParameters>0){b.nestedParameters--}if(b.nestedParameters>0){a.match(/.*?(?={|})/)||a.next()}else if(b.nestedParameters==0){b.tokenize=A}return"builtin"}function D(a,b){if(a.match(/^#=/)){b.nestedComments++}if(!a.match(/.*?(?=(#=|=#))/)){a.skipToEnd()}if(a.match(/^=#/)){b.nestedComments--;if(b.nestedComments==0)b.tokenize=A}return"comment"}function E(a,b){var c=false,d;if(a.match(l)){c=true}else if(d=a.match(/\\u([a-f0-9]{1,4})(?=')/i)){var e=parseInt(d[1],16);if(e<=55295||e>=57344){c=true;a.next()}}else if(d=a.match(/\\U([A-Fa-f0-9]{5,8})(?=')/)){var e=parseInt(d[1],16);if(e<=1114111){c=true;a.next()}}if(c){b.leavingExpr=true;b.tokenize=A;return"string"}if(!a.match(/^[^']+(?=')/)){a.skipToEnd()}if(a.match(/^'/)){b.tokenize=A}return"error"}function F(a){if(a.substr(-3)==='"""'){a='"""'}else if(a.substr(-1)==='"'){a='"'}function b(b,c){if(b.eat("\\")){b.next()}else if(b.match(a)){c.tokenize=A;c.leavingExpr=true;return"string"}else{b.eat(/[`"]/)}b.eatWhile(/[^\\`"]/);return"string"}return b}var G={startState:function(){return{tokenize:A,scopes:[],lastToken:null,leavingExpr:false,isDefinition:false,nestedArrays:0,nestedComments:0,nestedGenerators:0,nestedParameters:0,charsAdvanced:0,firstParenPos:-1}},token:function(a,b){var c=b.tokenize(a,b);var d=a.current();if(d&&c){b.lastToken=d}return c},indent:function(a,c){var d=0;if(c==="]"||c===")"||/^end\b/.test(c)||/^else/.test(c)||/^catch\b/.test(c)||/^elseif\b/.test(c)||/^finally/.test(c)){d=-1}return(a.scopes.length+d)*b.indentUnit},electricInput:/\b(end|else|catch|finally)\b/,blockCommentStart:"#=",blockCommentEnd:"=#",lineComment:"#",closeBrackets:'()[]{}""',fold:"indent"};return G});a.defineMIME("text/x-julia","julia")});
2//# sourceMappingURL=julia.min.js.map