!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("jinja2",function(){var i=["and","as","block","endblock","by","cycle","debug","else","elif","extends","filter","endfilter","firstof","for","endfor","if","endif","ifchanged","endifchanged","ifequal","endifequal","ifnotequal","endifnotequal","in","include","load","not","now","or","parsed","regroup","reversed","spaceless","endspaceless","ssi","templatetag","openblock","closeblock","openvariable","closevariable","openbrace","closebrace","opencomment","closecomment","widthratio","url","with","endwith","get_current_language","trans","endtrans","noop","blocktrans","endblocktrans","get_available_languages","get_current_language_bidi","plural"],r=/^[+\-*&%=<>!?|~^]/,o=/^[:\[\(\{]/,a=["true","false"],c=/^(\d[+\-\*\/])?\d+(\.\d+)?/;function e(e,n){var t=e.peek();if(n.incomment)return e.skipTo("#}")?(e.eatWhile(/\#|}/),n.incomment=!1):e.skipToEnd(),"comment";if(n.intag){if(n.operator){if(n.operator=!1,e.match(a))return"atom";if(e.match(c))return"number"}if(n.sign){if(n.sign=!1,e.match(a))return"atom";if(e.match(c))return"number"}if(n.instring)return t==n.instring&&(n.instring=!1),e.next(),"string";if("'"==t||'"'==t)return n.instring=t,e.next(),"string";if(e.match(n.intag+"}")||e.eat("-")&&e.match(n.intag+"}"))return n.intag=!1,"tag";if(e.match(r))return n.operator=!0,"operator";if(e.match(o))n.sign=!0;else if(e.eat(" ")||e.sol()){if(e.match(i))return"keyword";if(e.match(a))return"atom";if(e.match(c))return"number";e.sol()&&e.next()}else e.next();return"variable"}if(e.eat("{")){if(e.eat("#"))return n.incomment=!0,e.skipTo("#}")?(e.eatWhile(/\#|}/),n.incomment=!1):e.skipToEnd(),"comment";if(t=e.eat(/\{|%/))return"{"==(n.intag=t)&&(n.intag="}"),e.eat("-"),"tag"}e.next()}return i=new RegExp("(("+i.join(")|(")+"))\\b"),a=new RegExp("(("+a.join(")|(")+"))\\b"),{startState:function(){return{tokenize:e}},token:function(e,n){return n.tokenize(e,n)},blockCommentStart:"{#",blockCommentEnd:"#}"}}),e.defineMIME("text/jinja2","jinja2")});