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