(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],a)}else{a(CodeMirror)}}})(function(a){a.defineMode("groovy",function(d){function l(t){var r={},s=t.split(" ");for(var q=0;q<s.length;++q){r[s[q]]=true}return r}var f=l("abstract as assert boolean break byte case catch char class const continue def default do double else enum extends final finally float for goto if implements import in instanceof int interface long native new package private protected public return short static strictfp super switch synchronized threadsafe throw throws trait transient try void volatile while");var c=l("catch class def do else enum finally for if interface switch trait try while");var h=l("return break continue");var g=l("null true false this");var m;function e(t,r){var q=t.next();if(q=='"'||q=="'"){return n(q,t,r)}if(/[\[\]{}\(\),;\:\.]/.test(q)){m=q;return null}if(/\d/.test(q)){t.eatWhile(/[\w\.]/);if(t.eat(/eE/)){t.eat(/\+\-/);t.eatWhile(/\d/)}return"number"}if(q=="/"){if(t.eat("*")){r.tokenize.push(j);return j(t,r)}if(t.eat("/")){t.skipToEnd();return"comment"}if(b(r.lastToken,false)){return n(q,t,r)}}if(q=="-"&&t.eat(">")){m="->";return null}if(/[+\-*&%=<>!?|\/~]/.test(q)){t.eatWhile(/[+\-*&%=<>|~]/);return"operator"}t.eatWhile(/[\w\$_]/);if(q=="@"){t.eatWhile(/[\w\$_\.]/);return"meta"}if(r.lastToken=="."){return"property"}if(t.eat(":")){m="proplabel";return"property"}var s=t.current();if(g.propertyIsEnumerable(s)){return"atom"}if(f.propertyIsEnumerable(s)){if(c.propertyIsEnumerable(s)){m="newstatement"}else{if(h.propertyIsEnumerable(s)){m="standalone"}}return"keyword"}return"variable"}e.isBase=true;function n(q,v,u){var s=false;if(q!="/"&&v.eat(q)){if(v.eat(q)){s=true}else{return"string"}}function r(z,x){var y=false,w,t=!s;while((w=z.next())!=null){if(w==q&&!y){if(!s){break}if(z.match(q+q)){t=true;break}}if(q=='"'&&w=="$"&&!y&&z.eat("{")){x.tokenize.push(p());return"string"}y=!y&&w=="\\"}if(t){x.tokenize.pop()}return"string"}u.tokenize.push(r);return r(v,u)}function p(){var r=1;function q(t,s){if(t.peek()=="}"){r--;if(r==0){s.tokenize.pop();return s.tokenize[s.tokenize.length-1](t,s)}}else{if(t.peek()=="{"){r++}}return e(t,s)}q.isBase=true;return q}function j(t,s){var q=false,r;while(r=t.next()){if(r=="/"&&q){s.tokenize.pop();break}q=(r=="*")}return"comment"}function b(r,q){return !r||r=="operator"||r=="->"||/[\.\[\{\(,;:]/.test(r)||r=="newstatement"||r=="keyword"||r=="proplabel"||(r=="standalone"&&!q)}function o(u,r,q,t,s){this.indented=u;this.column=r;this.type=q;this.align=t;this.prev=s}function i(s,q,r){return s.context=new o(s.indented,q,r,null,s.context)}function k(r){var q=r.context.type;if(q==")"||q=="]"||q=="}"){r.indented=r.context.indented}return r.context=r.context.prev}return{startState:function(q){return{tokenize:[e],context:new o((q||0)-d.indentUnit,0,"top",false),indented:0,startOfLine:true,lastToken:null}},token:function(t,s){var q=s.context;if(t.sol()){if(q.align==null){q.align=false}s.indented=t.indentation();s.startOfLine=true;if(q.type=="statement"&&!b(s.lastToken,true)){k(s);q=s.context}}if(t.eatSpace()){return null}m=null;var r=s.tokenize[s.tokenize.length-1](t,s);if(r=="comment"){return r}if(q.align==null){q.align=true}if((m==";"||m==":")&&q.type=="statement"){k(s)}else{if(m=="->"&&q.type=="statement"&&q.prev.type=="}"){k(s);s.context.align=false}else{if(m=="{"){i(s,t.column(),"}")}else{if(m=="["){i(s,t.column(),"]")}else{if(m=="("){i(s,t.column(),")")}else{if(m=="}"){while(q.type=="statement"){q=k(s)}if(q.type=="}"){q=k(s)}while(q.type=="statement"){q=k(s)}}else{if(m==q.type){k(s)}else{if(q.type=="}"||q.type=="top"||(q.type=="statement"&&m=="newstatement")){i(s,t.column(),"statement")}}}}}}}}s.startOfLine=false;s.lastToken=m||r;return r},indent:function(u,r){if(!u.tokenize[u.tokenize.length-1].isBase){return a.Pass}var t=r&&r.charAt(0),q=u.context;if(q.type=="statement"&&!b(u.lastToken,true)){q=q.prev}var s=t==q.type;if(q.type=="statement"){return q.indented+(t=="{"?0:d.indentUnit)}else{if(q.align){return q.column+(s?0:1)}else{return q.indented+(s?0:d.indentUnit)}}},electricChars:"{}",closeBrackets:{triples:"'\""},fold:"brace"}});a.defineMIME("text/x-groovy","groovy")});
