物管理前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1 lines
1.9 KiB

var o="[a-zA-Z\\$][a-zA-Z0-9\\$]*",A="(?:\\d+)",z="(?:\\.\\d+|\\d+\\.\\d*|\\d+)",Z="(?:\\.\\w+|\\w+\\.\\w*|\\w+)",r="(?:`(?:`?"+z+")?)",$=new RegExp("(?:"+A+"(?:\\^\\^"+Z+r+"?(?:\\*\\^[+-]?\\d+)?))"),i=new RegExp("(?:"+z+r+"?(?:\\*\\^[+-]?\\d+)?)"),l=new RegExp("(?:`?)(?:"+o+")(?:`(?:"+o+"))*(?:`?)");function m(a,t){var e;return e=a.next(),e==='"'?(t.tokenize=u,t.tokenize(a,t)):e==="("&&a.eat("*")?(t.commentLevel++,t.tokenize=h,t.tokenize(a,t)):(a.backUp(1),a.match($,!0,!1)||a.match(i,!0,!1)?"number":a.match(/(?:In|Out)\[[0-9]*\]/,!0,!1)?"atom":a.match(/([a-zA-Z\$][a-zA-Z0-9\$]*(?:`[a-zA-Z0-9\$]+)*::usage)/,!0,!1)?"meta":a.match(/([a-zA-Z\$][a-zA-Z0-9\$]*(?:`[a-zA-Z0-9\$]+)*::[a-zA-Z\$][a-zA-Z0-9\$]*):?/,!0,!1)?"string.special":a.match(/([a-zA-Z\$][a-zA-Z0-9\$]*\s*:)(?:(?:[a-zA-Z\$][a-zA-Z0-9\$]*)|(?:[^:=>~@\^\&\*\)\[\]'\?,\|])).*/,!0,!1)||a.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+[a-zA-Z\$][a-zA-Z0-9\$]*/,!0,!1)||a.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+/,!0,!1)||a.match(/_+[a-zA-Z\$][a-zA-Z0-9\$]*/,!0,!1)?"variableName.special":a.match(/\\\[[a-zA-Z\$][a-zA-Z0-9\$]*\]/,!0,!1)?"character":a.match(/(?:\[|\]|{|}|\(|\))/,!0,!1)?"bracket":a.match(/(?:#[a-zA-Z\$][a-zA-Z0-9\$]*|#+[0-9]?)/,!0,!1)?"variableName.constant":a.match(l,!0,!1)?"keyword":a.match(/(?:\\|\+|\-|\*|\/|,|;|\.|:|@|~|=|>|<|&|\||_|`|'|\^|\?|!|%)/,!0,!1)?"operator":(a.next(),"error"))}function u(a,t){for(var e,n=!1,c=!1;(e=a.next())!=null;){if(e==='"'&&!c){n=!0;break}c=!c&&e==="\\"}return n&&!c&&(t.tokenize=m),"string"}function h(a,t){for(var e,n;t.commentLevel>0&&(n=a.next())!=null;)e==="("&&n==="*"&&t.commentLevel++,e==="*"&&n===")"&&t.commentLevel--,e=n;return t.commentLevel<=0&&(t.tokenize=m),"comment"}const k={name:"mathematica",startState:function(){return{tokenize:m,commentLevel:0}},token:function(a,t){return a.eatSpace()?null:t.tokenize(a,t)},languageData:{commentTokens:{block:{open:"(*",close:"*)"}}}};export{k as mathematica};