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