!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function n(e,n){for(var t=0;t<e.length;t++)n(e[t],t)}function t(e,n){for(var t=0;t<e.length;t++)if(n(e[t],t))return!0;return!1}e.defineMode("dylan",function(e){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 r="[-_a-zA-Z?!*@<>$%]+",o=new RegExp("^"+r),a={symbolKeyword:r+":",symbolClass:"<"+r+">",symbolGlobal:"\\*"+r+"\\*",symbolConstant:"\\$"+r},f={symbolKeyword:"atom",symbolClass:"tag",symbolGlobal:"variable-2",symbolConstant:"variable-3"};for(var l in a)a.hasOwnProperty(l)&&(a[l]=new RegExp("^"+a[l]));a.keyword=[/^with(?:out)?-[-_a-zA-Z?!*@<>$%]+/];var c={keyword:"keyword",definition:"def",simpleDefinition:"def",signalingCalls:"builtin"},u={},s={};function m(e,n,t){return n.tokenize=t,t(e,n)}function d(e,n){var i=e.peek();if("'"==i||'"'==i)return e.next(),m(e,n,b(i,"string"));if("/"==i){if(e.next(),e.eat("*"))return m(e,n,p);if(e.eat("/"))return e.skipToEnd(),"comment";e.backUp(1)}else if(/[+\-\d\.]/.test(i)){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("#"==i)return e.next(),'"'==(i=e.peek())?(e.next(),m(e,n,b('"',"string"))):"b"==i?(e.next(),e.eatWhile(/[01]/),"number"):"x"==i?(e.next(),e.eatWhile(/[\da-f]/i),"number"):"o"==i?(e.next(),e.eatWhile(/[0-7]/),"number"):"#"==i?(e.next(),"punctuation"):"["==i||"("==i?(e.next(),"bracket"):e.match(/f|t|all-keys|include|key|next|rest/i)?"atom":(e.eatWhile(/[-a-zA-Z]/),"error");if("~"==i)return e.next(),"="==(i=e.peek())?(e.next(),"="==(i=e.peek())?(e.next(),"operator"):"operator"):"operator";if(":"==i){if(e.next(),"="==(i=e.peek()))return e.next(),"operator";if(":"==i)return e.next(),"punctuation"}else{if(-1!="[](){}".indexOf(i))return e.next(),"bracket";if(-1!=".,".indexOf(i))return e.next(),"punctuation";if(e.match("end"))return"keyword"}}for(var r in a)if(a.hasOwnProperty(r)){var l=a[r];if(l instanceof Array&&t(l,function(n){return e.match(n)})||e.match(l))return f[r]}return/[+\-*\/^=<>&|]/.test(i)?(e.next(),"operator"):e.match("define")?"def":(e.eatWhile(/[\w\-]/),u.hasOwnProperty(e.current())?s[e.current()]:e.current().match(o)?"variable":(e.next(),"variable-2"))}function p(e,n){for(var t,i=!1,r=!1,o=0;t=e.next();){if("/"==t&&i){if(!(o>0)){n.tokenize=d;break}o--}else"*"==t&&r&&o++;i="*"==t,r="/"==t}return"comment"}function b(e,n){return function(t,i){for(var r,o=!1,a=!1;null!=(r=t.next());){if(r==e&&!o){a=!0;break}o=!o&&"\\"==r}return!a&&o||(i.tokenize=d),n}}return n(["keyword","definition","simpleDefinition","signalingCalls"],function(e){n(i[e],function(n){u[n]=e,s[n]=c[e]})}),{startState:function(){return{tokenize:d,currentIndent:0}},token:function(e,n){return e.eatSpace()?null:n.tokenize(e,n)},blockCommentStart:"/*",blockCommentEnd:"*/"}}),e.defineMIME("text/x-dylan","dylan")});