Current File : /home/pacjaorg/public_html/kmm/media/vendor/codemirror/mode/dylan/dylan.min.js |
(function(u){typeof exports=="object"&&typeof module=="object"?u(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],u):u(CodeMirror)})(function(u){"use strict";function y(c,i){for(var o=0;o<c.length;o++)i(c[o],o)}function w(c,i){for(var o=0;o<c.length;o++)if(i(c[o],o))return!0;return!1}u.defineMode("dylan",function(c){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 o="[-_a-zA-Z?!*@<>$%]+",D=new RegExp("^"+o),f={symbolKeyword:o+":",symbolClass:"<"+o+">",symbolGlobal:"\\*"+o+"\\*",symbolConstant:"\\$"+o},C={symbolKeyword:"atom",symbolClass:"tag",symbolGlobal:"variable-2",symbolConstant:"variable-3"};for(var s in f)f.hasOwnProperty(s)&&(f[s]=new RegExp("^"+f[s]));f.keyword=[/^with(?:out)?-[-_a-zA-Z?!*@<>$%]+/];var d={};d.keyword="keyword",d.definition="def",d.simpleDefinition="def",d.signalingCalls="builtin";var h={},k={};y(["keyword","definition","simpleDefinition","signalingCalls"],function(e){y(i[e],function(t){h[t]=e,k[t]=d[e]})});function b(e,t,n){return t.tokenize=n,n(e,t)}function p(e,t){var n=e.peek();if(n=="'"||n=='"')return e.next(),b(e,t,x(n,"string"));if(n=="/"){if(e.next(),e.eat("*"))return b(e,t,g);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(),b(e,t,x('"',"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"):"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 a in f)if(f.hasOwnProperty(a)){var r=f[a];if(r instanceof Array&&w(r,function(l){return e.match(l)})||e.match(r))return C[a]}return/[+\-*\/^=<>&|]/.test(n)?(e.next(),"operator"):e.match("define")?"def":(e.eatWhile(/[\w\-]/),h.hasOwnProperty(e.current())?k[e.current()]:e.current().match(D)?"variable":(e.next(),"variable-2"))}function g(e,t){for(var n=!1,a=!1,r=0,l;l=e.next();){if(l=="/"&&n)if(r>0)r--;else{t.tokenize=p;break}else l=="*"&&a&&r++;n=l=="*",a=l=="/"}return"comment"}function x(e,t){return function(n,a){for(var r=!1,l,v=!1;(l=n.next())!=null;){if(l==e&&!r){v=!0;break}r=!r&&l=="\\"}return(v||!r)&&(a.tokenize=p),t}}return{startState:function(){return{tokenize:p,currentIndent:0}},token:function(e,t){if(e.eatSpace())return null;var n=t.tokenize(e,t);return n},blockCommentStart:"/*",blockCommentEnd:"*/"}}),u.defineMIME("text/x-dylan","dylan")});