!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../../addon/mode/multiplex")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../addon/mode/multiplex"],e):e(CodeMirror)}(function(i){"use strict";i.defineMode("twig:inner",function(){var i=["and","as","autoescape","endautoescape","block","do","endblock","else","elseif","extends","for","endfor","embed","endembed","filter","endfilter","flush","from","if","endif","in","is","include","import","not","or","set","spaceless","endspaceless","with","endwith","trans","endtrans","blocktrans","endblocktrans","macro","endmacro","use","verbatim","endverbatim"],r=/^[+\-*&%=<>!?|~^]/,o=/^[:\[\(\{]/,a=["true","false","null","empty","defined","divisibleby","divisible by","even","odd","iterable","sameas","same as"],d=/^(\d[+\-\*\/])?\d+(\.\d+)?/;return i=new RegExp("(("+i.join(")|(")+"))\\b"),a=new RegExp("(("+a.join(")|(")+"))\\b"),{startState:function(){return{}},token:function(e,t){return function(e,t){var n=e.peek();if(t.incomment)return e.skipTo("#}")?(e.eatWhile(/\#|}/),t.incomment=!1):e.skipToEnd(),"comment";if(t.intag){if(t.operator){if(t.operator=!1,e.match(a))return"atom";if(e.match(d))return"number"}if(t.sign){if(t.sign=!1,e.match(a))return"atom";if(e.match(d))return"number"}if(t.instring)return n==t.instring&&(t.instring=!1),e.next(),"string";if("'"==n||'"'==n)return t.instring=n,e.next(),"string";if(e.match(t.intag+"}")||e.eat("-")&&e.match(t.intag+"}"))return t.intag=!1,"tag";if(e.match(r))return t.operator=!0,"operator";if(e.match(o))t.sign=!0;else if(e.eat(" ")||e.sol()){if(e.match(i))return"keyword";if(e.match(a))return"atom";if(e.match(d))return"number";e.sol()&&e.next()}else e.next();return"variable"}if(e.eat("{")){if(e.eat("#"))return t.incomment=!0,e.skipTo("#}")?(e.eatWhile(/\#|}/),t.incomment=!1):e.skipToEnd(),"comment";if(n=e.eat(/\{|%/))return"{"==(t.intag=n)&&(t.intag="}"),e.eat("-"),"tag"}e.next()}(e,t)}}}),i.defineMode("twig",function(e,t){var n=i.getMode(e,"twig:inner");return t&&t.base?i.multiplexingMode(i.getMode(e,t.base),{open:/\{[{#%]/,close:/[}#%]\}/,mode:n,parseDelimiters:!0}):n}),i.defineMIME("text/x-twig","twig")});