物管理前端
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
3.9 KiB

function p(e,t){for(var n=0;n<e.length;n++)t(e[n],n)}function k(e,t){for(var n=0;n<e.length;n++)if(t(e[n],n))return!0;return!1}var i={unnamedDefinition:["interface"],namedDefinition:["module","library","macro","C-struct","C-union","C-function","C-callable-wrapper"],typeParameterizedDefinition:["class","C-subtype","C-mapped-subtype"],otherParameterizedDefinition:["method","function","C-variable","C-address"],constantSimpleDefinition:["constant"],variableSimpleDefinition:["variable"],otherSimpleDefinition:["generic","domain","C-pointer-type","table"],statement:["if","block","begin","method","case","for","select","when","unless","until","while","iterate","profiling","dynamic-bind"],separator:["finally","exception","cleanup","else","elseif","afterwards"],other:["above","below","by","from","handler","in","instance","let","local","otherwise","slot","subclass","then","to","keyed-by","virtual"],signalingCalls:["signal","error","cerror","break","check-type","abort"]};i.otherDefinition=i.unnamedDefinition.concat(i.namedDefinition).concat(i.otherParameterizedDefinition);i.definition=i.typeParameterizedDefinition.concat(i.otherDefinition);i.parameterizedDefinition=i.typeParameterizedDefinition.concat(i.otherParameterizedDefinition);i.simpleDefinition=i.constantSimpleDefinition.concat(i.variableSimpleDefinition).concat(i.otherSimpleDefinition);i.keyword=i.statement.concat(i.separator).concat(i.other);var f="[-_a-zA-Z?!*@<>$%]+",x=new RegExp("^"+f),l={symbolKeyword:f+":",symbolClass:"<"+f+">",symbolGlobal:"\\*"+f+"\\*",symbolConstant:"\\$"+f},v={symbolKeyword:"atom",symbolClass:"tag",symbolGlobal:"variableName.standard",symbolConstant:"variableName.constant"};for(var s in l)l.hasOwnProperty(s)&&(l[s]=new RegExp("^"+l[s]));l.keyword=[/^with(?:out)?-[-_a-zA-Z?!*@<>$%]+/];var c={};c.keyword="keyword";c.definition="def";c.simpleDefinition="def";c.signalingCalls="builtin";var h={},y={};p(["keyword","definition","simpleDefinition","signalingCalls"],function(e){p(i[e],function(t){h[t]=e,y[t]=c[e]})});function u(e,t,n){return t.tokenize=n,n(e,t)}function m(e,t){var n=e.peek();if(n=="'"||n=='"')return e.next(),u(e,t,b(n,"string"));if(n=="/"){if(e.next(),e.eat("*"))return u(e,t,D);if(e.eat("/"))return e.skipToEnd(),"comment";e.backUp(1)}else if(/[+\-\d\.]/.test(n)){if(e.match(/^[+-]?[0-9]*\.[0-9]*([esdx][+-]?[0-9]+)?/i)||e.match(/^[+-]?[0-9]+([esdx][+-]?[0-9]+)/i)||e.match(/^[+-]?\d+/))return"number"}else{if(n=="#")return e.next(),n=e.peek(),n=='"'?(e.next(),u(e,t,b('"',"string"))):n=="b"?(e.next(),e.eatWhile(/[01]/),"number"):n=="x"?(e.next(),e.eatWhile(/[\da-f]/i),"number"):n=="o"?(e.next(),e.eatWhile(/[0-7]/),"number"):n=="#"?(e.next(),"punctuation"):n=="["||n=="("?(e.next(),"bracket"):e.match(/f|t|all-keys|include|key|next|rest/i)?"atom":(e.eatWhile(/[-a-zA-Z]/),"error");if(n=="~")return e.next(),n=e.peek(),n=="="&&(e.next(),n=e.peek(),n=="="&&e.next()),"operator";if(n==":"){if(e.next(),n=e.peek(),n=="=")return e.next(),"operator";if(n==":")return e.next(),"punctuation"}else{if("[](){}".indexOf(n)!=-1)return e.next(),"bracket";if(".,".indexOf(n)!=-1)return e.next(),"punctuation";if(e.match("end"))return"keyword"}}for(var o in l)if(l.hasOwnProperty(o)){var r=l[o];if(r instanceof Array&&k(r,function(a){return e.match(a)})||e.match(r))return v[o]}return/[+\-*\/^=<>&|]/.test(n)?(e.next(),"operator"):e.match("define")?"def":(e.eatWhile(/[\w\-]/),h.hasOwnProperty(e.current())?y[e.current()]:e.current().match(x)?"variable":(e.next(),"variableName.standard"))}function D(e,t){for(var n=!1,o=!1,r=0,a;a=e.next();){if(a=="/"&&n)if(r>0)r--;else{t.tokenize=m;break}else a=="*"&&o&&r++;n=a=="*",o=a=="/"}return"comment"}function b(e,t){return function(n,o){for(var r=!1,a,d=!1;(a=n.next())!=null;){if(a==e&&!r){d=!0;break}r=!r&&a=="\\"}return(d||!r)&&(o.tokenize=m),t}}const w={name:"dylan",startState:function(){return{tokenize:m,currentIndent:0}},token:function(e,t){if(e.eatSpace())return null;var n=t.tokenize(e,t);return n},languageData:{commentTokens:{block:{open:"/*",close:"*/"}}}};export{w as dylan};