function p(e,n){for(var t=0;t<e.length;t++)n(e[t],t)}function k(e,n){for(var t=0;t<e.length;t++)if(n(e[t],t))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=RegExp("^"+f),l={symbolKeyword:f+":",symbolClass:"<"+f+">",symbolGlobal:"\\*"+f+"\\*",symbolConstant:"\\$"+f},D={symbolKeyword:"atom",symbolClass:"tag",symbolGlobal:"variableName.standard",symbolConstant:"variableName.constant"};for(var s in l)l.hasOwnProperty(s)&&(l[s]=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 b={},h={};p(["keyword","definition","simpleDefinition","signalingCalls"],function(e){p(i[e],function(n){b[n]=e,h[n]=c[e]})});function u(e,n,t){return n.tokenize=t,t(e,n)}function m(e,n){var t=e.peek();if(t=="'"||t=='"')return e.next(),u(e,n,y(t,"string"));if(t=="/"){if(e.next(),e.eat("*"))return u(e,n,v);if(e.eat("/"))return e.skipToEnd(),"comment";e.backUp(1)}else if(/[+\-\d\.]/.test(t)){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(t=="#")return e.next(),t=e.peek(),t=='"'?(e.next(),u(e,n,y('"',"string"))):t=="b"?(e.next(),e.eatWhile(/[01]/),"number"):t=="x"?(e.next(),e.eatWhile(/[\da-f]/i),"number"):t=="o"?(e.next(),e.eatWhile(/[0-7]/),"number"):t=="#"?(e.next(),"punctuation"):t=="["||t=="("?(e.next(),"bracket"):e.match(/f|t|all-keys|include|key|next|rest/i)?"atom":(e.eatWhile(/[-a-zA-Z]/),"error");if(t=="~")return e.next(),t=e.peek(),t=="="&&(e.next(),t=e.peek(),t=="="&&e.next()),"operator";if(t==":"){if(e.next(),t=e.peek(),t=="=")return e.next(),"operator";if(t==":")return e.next(),"punctuation"}else{if("[](){}".indexOf(t)!=-1)return e.next(),"bracket";if(".,".indexOf(t)!=-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 D[o]}return/[+\-*\/^=<>&|]/.test(t)?(e.next(),"operator"):e.match("define")?"def":(e.eatWhile(/[\w\-]/),b.hasOwnProperty(e.current())?h[e.current()]:e.current().match(x)?"variable":(e.next(),"variableName.standard"))}function v(e,n){for(var t=!1,o=!1,r=0,a;a=e.next();){if(a=="/"&&t)if(r>0)r--;else{n.tokenize=m;break}else a=="*"&&o&&r++;t=a=="*",o=a=="/"}return"comment"}function y(e,n){return function(t,o){for(var r=!1,a,d=!1;(a=t.next())!=null;){if(a==e&&!r){d=!0;break}r=!r&&a=="\\"}return(d||!r)&&(o.tokenize=m),n}}const g={name:"dylan",startState:function(){return{tokenize:m,currentIndent:0}},token:function(e,n){return e.eatSpace()?null:n.tokenize(e,n)},languageData:{commentTokens:{block:{open:"/*",close:"*/"}}}};export{g as t};
