!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";e.defineMode("ebnf",(function(t){var a=0,r=1,c=0,n=1,i=2,o=null;return t.bracesMode&&(o=e.getMode(t,t.bracesMode)),{startState:function(){return{stringType:null,commentType:null,braced:0,lhs:!0,localState:null,stack:[],inDefinition:!1}},token:function(t,s){if(t){switch(0===s.stack.length&&('"'==t.peek()||"'"==t.peek()?(s.stringType=t.peek(),t.next(),s.stack.unshift(n)):t.match("/*")?(s.stack.unshift(c),s.commentType=a):t.match("(*")&&(s.stack.unshift(c),s.commentType=r)),s.stack[0]){case n:for(;s.stack[0]===n&&!t.eol();)t.peek()===s.stringType?(t.next(),s.stack.shift()):"\\"===t.peek()?(t.next(),t.next()):t.match(/^.[^\\\"\']*/);return s.lhs?"property string":"string";case c:for(;s.stack[0]===c&&!t.eol();)s.commentType===a&&t.match("*/")||s.commentType===r&&t.match("*)")?(s.stack.shift(),s.commentType=null):t.match(/^.[^\*]*/);return"comment";case i:for(;s.stack[0]===i&&!t.eol();)t.match(/^[^\]\\]+/)||t.match(".")||s.stack.shift();return"operator"}var m=t.peek();if(null!==o&&(s.braced||"{"===m)){null===s.localState&&(s.localState=e.startState(o));var f=o.token(t,s.localState),u=t.current();if(!f)for(var h=0;h>/))return"builtin"}return t.match("//")?(t.skipToEnd(),"comment"):t.match("return")?"operator":t.match(/^[a-zA-Z_][a-zA-Z0-9_]*/)?t.match(/(?=[\(.])/)?"variable":t.match(/(?=[\s\n]*[:=])/)?"def":"variable-2":-1!=["[","]","(",")"].indexOf(t.peek())?(t.next(),"bracket"):(t.eatSpace()||t.next(),null)}}}})),e.defineMIME("text/x-ebnf","ebnf")}));