'use strict';(function(c){"object"==typeof exports&&"object"==typeof module?c(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],c):c(CodeMirror)})(function(c){c.defineMode("jinja2",function(){function c(a,b){var c=a.peek();if(b.incomment)return a.skipTo("#}")?(a.eatWhile(/#|}/),b.incomment=!1):a.skipToEnd(),"comment";if(b.intag){if(b.operator){b.operator=!1;if(a.match(d))return"atom";if(a.match(e))return"number"}if(b.sign){b.sign=!1;if(a.match(d))return"atom";
if(a.match(e))return"number"}if(b.instring)return c==b.instring&&(b.instring=!1),a.next(),"string";if("'"==c||'"'==c)return b.instring=c,a.next(),"string";if(a.match(b.intag+"}")||a.eat("-")&&a.match(b.intag+"}"))return b.intag=!1,"tag";if(a.match(g))return b.operator=!0,"operator";if(a.match(h))b.sign=!0;else if(a.eat(" ")||a.sol()){if(a.match(f))return"keyword";if(a.match(d))return"atom";if(a.match(e))return"number";a.sol()&&a.next()}else a.next();return"variable"}if(a.eat("{")){if(a.eat("#"))return b.incomment=
!0,a.skipTo("#}")?(a.eatWhile(/#|}/),b.incomment=!1):a.skipToEnd(),"comment";if(c=a.eat(/\{|%/))return b.intag=c,"{"==c&&(b.intag="}"),a.eat("-"),"tag"}a.next()}var f="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".split(" "),
g=/^[+\-*&%=<>!?|~^]/,h=/^[:\[\(\{]/,d=["true","false"],e=/^(\d[+\-\*\/])?\d+(\.\d+)?/;f=new RegExp("(("+f.join(")|(")+"))\\b");d=new RegExp("(("+d.join(")|(")+"))\\b");return{startState:function(){return{tokenize:c}},token:function(a,b){return b.tokenize(a,b)},blockCommentStart:"{#",blockCommentEnd:"#}"}});c.defineMIME("text/jinja2","jinja2")});
