text: ﻿(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"),require("../javascript/javascript"),require("../css/css"),require("../htmlmixed/htmlmixed"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror","../javascript/javascript","../css/css","../htmlmixed/htmlmixed"],a)}else{a(CodeMirror)}}})(function(a){a.defineMode("pug",function(q){var N="keyword";var u="meta";var C="builtin";var k="qualifier";var e={"{":"}","(":")","[":"]"};var M=a.getMode(q,"javascript");function U(){this.javaScriptLine=false;this.javaScriptLineExcludesColon=false;this.javaScriptArguments=false;this.javaScriptArgumentsDepth=0;this.isInterpolating=false;this.interpolationNesting=0;this.jsState=a.startState(M);this.restOfLine="";this.isIncludeFiltered=false;this.isEach=false;this.lastTag="";this.scriptType="";this.isAttrs=false;this.attrsNest=[];this.inAttributeName=true;this.attributeIsType=false;this.attrValue="";this.indentOf=Infinity;this.indentToken="";this.innerMode=null;this.innerState=null;this.innerModeForLine=false}U.prototype.copy=function(){var aa=new U();aa.javaScriptLine=this.javaScriptLine;aa.javaScriptLineExcludesColon=this.javaScriptLineExcludesColon;aa.javaScriptArguments=this.javaScriptArguments;aa.javaScriptArgumentsDepth=this.javaScriptArgumentsDepth;aa.isInterpolating=this.isInterpolating;aa.interpolationNesting=this.interpolationNesting;aa.jsState=a.copyState(M,this.jsState);aa.innerMode=this.innerMode;if(this.innerMode&&this.innerState){aa.innerState=a.copyState(this.innerMode,this.innerState)}aa.restOfLine=this.restOfLine;aa.isIncludeFiltered=this.isIncludeFiltered;aa.isEach=this.isEach;aa.lastTag=this.lastTag;aa.scriptType=this.scriptType;aa.isAttrs=this.isAttrs;aa.attrsNest=this.attrsNest.slice();aa.inAttributeName=this.inAttributeName;aa.attributeIsType=this.attributeIsType;aa.attrValue=this.attrValue;aa.indentOf=this.indentOf;aa.indentToken=this.indentToken;aa.innerModeForLine=this.innerModeForLine;return aa};function K(ab,aa){if(ab.sol()){aa.javaScriptLine=false;aa.javaScriptLineExcludesColon=false}if(aa.javaScriptLine){if(aa.javaScriptLineExcludesColon&&ab.peek()===":"){aa.javaScriptLine=false;aa.javaScriptLineExcludesColon=false;return}var ac=M.token(ab,aa.jsState);if(ab.eol()){aa.javaScriptLine=false}return ac||true}}function L(ab,aa){if(aa.javaScriptArguments){if(aa.javaScriptArgumentsDepth===0&&ab.peek()!=="("){aa.javaScriptArguments=false;return}if(ab.peek()==="("){aa.javaScriptArgumentsDepth++}else{if(ab.peek()===")"){aa.javaScriptArgumentsDepth--}}if(aa.javaScriptArgumentsDepth===0){aa.javaScriptArguments=false;return}var ac=M.token(ab,aa.jsState);return ac||true}}function Z(aa){if(aa.match(/^yield\b/)){return"keyword"}}function t(aa){if(aa.match(/^(?:doctype) *([^\n]+)?/)){return u}}function I(ab,aa){if(ab.match("#{")){aa.isInterpolating=true;aa.interpolationNesting=0;return"punctuation"}}function J(ab,aa){if(aa.isInterpolating){if(ab.peek()==="}"){aa.interpolationNesting--;if(aa.interpolationNesting<0){ab.next();aa.isInterpolating=false;return"punctuation"}}else{if(ab.peek()==="{"){aa.interpolationNesting++}}return M.token(ab,aa.jsState)||true}}function j(ab,aa){if(ab.match(/^case\b/)){aa.javaScriptLine=true;return N}}function X(ab,aa){if(ab.match(/^when\b/)){aa.javaScriptLine=true;aa.javaScriptLineExcludesColon=true;return N}}function s(aa){if(aa.match(/^default\b/)){return N}}function y(ab,aa){if(ab.match(/^extends?\b/)){aa.restOfLine="string";return N}}function b(ab,aa){if(ab.match(/^append\b/)){aa.restOfLine="variable";return N}}function Q(ab,aa){if(ab.match(/^prepend\b/)){aa.restOfLine="variable";return N}}function g(ab,aa){if(ab.match(/^block\b *(?:(prepend|append)\b)?/)){aa.restOfLine="variable";return N}}function D(ab,aa){if(ab.match(/^include\b/)){aa.restOfLine="string";return N}}function E(ab,aa){if(ab.match(/^include:([a-zA-Z0-9\-]+)/,false)&&ab.match("include")){aa.isIncludeFiltered=true;return N}}function F(ab,aa){if(aa.isIncludeFiltered){var ac=A(ab,aa);aa.isIncludeFiltered=false;aa.restOfLine="string";return ac}}function O(ab,aa){if(ab.match(/^mixin\b/)){aa.javaScriptLine=true;return N}}function h(ab,aa){if(ab.match(/^\+([-\w]+)/)){if(!ab.match(/^\( *[-\w]+ *=/,false)){aa.javaScriptArguments=true;aa.javaScriptArgumentsDepth=0}return"variable"}if(ab.match(/^\+#{/,false)){ab.next();aa.mixinCallAfter=true;return I(ab,aa)}}function i(ab,aa){if(aa.mixinCallAfter){aa.mixinCallAfter=false;if(!ab.match(/^\( *[-\w]+ *=/,false)){aa.javaScriptArguments=true;aa.javaScriptArgumentsDepth=0}return true}}function p(ab,aa){if(ab.match(/^(if|unless|else if|else)\b/)){aa.javaScriptLine=true;return N}}function w(ab,aa){if(ab.match(/^(- *)?(each|for)\b/)){aa.isEach=true;return N}}function x(ab,aa){if(aa.isEach){if(ab.match(/^ in\b/)){aa.javaScriptLine=true;aa.isEach=false;return N}else{if(ab.sol()||ab.eol()){aa.isEach=false}else{if(ab.next()){while(!ab.match(/^ in\b/,false)&&ab.next()){}return"variable"}}}}}function Y(ab,aa){if(ab.match(/^while\b/)){aa.javaScriptLine=true;return N}}function V(ac,ab){var aa;if(aa=ac.match(/^(\w(?:[-:\w]*\w)?)\/?/)){ab.lastTag=aa[1].toLowerCase();if(ab.lastTag==="script"){ab.scriptType="application/javascript"}return"tag"}}function A(ac,ab){if(ac.match(/^:([\w\-]+)/)){var aa;if(q&&q.innerModes){aa=q.innerModes(ac.current().substring(1))}if(!aa){aa=ac.current().substring(1)}if(typeof aa==="string"){aa=a.getMode(q,aa)}S(ac,ab,aa);return"atom"}}function m(ab,aa){if(ab.match(/^(!?=|-)/)){aa.javaScriptLine=true;return"punctuation"}}function B(aa){if(aa.match(/^#([\w-]+)/)){return C}}function l(aa){if(aa.match(/^\.([\w-]+)/)){return k}}function d(ab,aa){if(ab.peek()=="("){ab.next();aa.isAttrs=true;aa.attrsNest=[];aa.inAttributeName=true;aa.attrValue="";aa.attributeIsType=false;return"punctuation"}}function f(ac,ab){if(ab.isAttrs){if(e[ac.peek()]){ab.attrsNest.push(e[ac.peek()])}if(ab.attrsNest[ab.attrsNest.length-1]===ac.peek()){ab.attrsNest.pop()}else{if(ac.eat(")")){ab.isAttrs=false;return"punctuation"}}if(ab.inAttributeName&&ac.match(/^[^=,\)!]+/)){if(ac.peek()==="="||ac.peek()==="!"){ab.inAttributeName=false;ab.jsState=a.startState(M);if(ab.lastTag==="script"&&ac.current().trim().toLowerCase()==="type"){ab.attributeIsType=true}else{ab.attributeIsType=false}}return"attribute"}var ad=M.token(ac,ab.jsState);if(ab.attributeIsType&&ad==="string"){ab.scriptType=ac.current().toString()}if(ab.attrsNest.length===0&&(ad==="string"||ad==="variable"||ad==="keyword")){try{Function("","var x "+ab.attrValue.replace(/,\s*$/,"").replace(/^!/,""));ab.inAttributeName=true;ab.attrValue="";ac.backUp(ac.current().length);return f(ac,ab)}catch(aa){}}ab.attrValue+=ac.current();return ad||true}}function c(ab,aa){if(ab.match(/^&attributes\b/)){aa.javaScriptArguments=true;aa.javaScriptArgumentsDepth=0;return"keyword"}}function G(aa){if(aa.sol()&&aa.eatSpace()){return"indent"}}function o(ab,aa){if(ab.match(/^ *\/\/(-)?([^\n]*)/)){aa.indentOf=ab.indentation();aa.indentToken="comment";return"comment"}}function n(aa){if(aa.match(/^: */)){return"colon"}}function W(ab,aa){if(ab.match(/^(?:\| ?| )([^\n]+)/)){return"string"}if(ab.match(/^(<[^\n]*)/,false)){S(ab,aa,"htmlmixed");aa.innerModeForLine=true;return H(ab,aa,true)}}function v(ac,ab){if(ac.eat(".")){var aa=null;if(ab.lastTag==="script"&&ab.scriptType.toLowerCase().indexOf("javascript")!=-1){aa=ab.scriptType.toLowerCase().replace(/"|'/g,"")}else{if(ab.lastTag==="style"){aa="css"}}S(ac,ab,aa);return"dot"}}function z(aa){aa.next();return null}function S(ac,ab,aa){aa=a.mimeModes[aa]||aa;aa=q.innerModes?q.innerModes(aa)||aa:aa;aa=a.mimeModes[aa]||aa;aa=a.getMode(q,aa);ab.indentOf=ac.indentation();if(aa&&aa.name!=="null"){ab.innerMode=aa}else{ab.indentToken="string"}}function H(ac,ab,aa){if(ac.indentation()>ab.indentOf||(ab.innerModeForLine&&!ac.sol())||aa){if(ab.innerMode){if(!ab.innerState){ab.innerState=ab.innerMode.startState?a.startState(ab.innerMode,ac.indentation()):{}}return ac.hideFirstChars(ab.indentOf+2,function(){return ab.innerMode.token(ac,ab.innerState)||true})}else{ac.skipToEnd();return ab.indentToken}}else{if(ac.sol()){ab.indentOf=Infinity;ab.indentToken=null;ab.innerMode=null;ab.innerState=null}}}function R(ab,aa){if(ab.sol()){aa.restOfLine=""}if(aa.restOfLine){ab.skipToEnd();var ac=aa.restOfLine;aa.restOfLine="";return ac}}function T(){return new U()}function r(aa){return aa.copy()}function P(ab,aa){var ac=H(ab,aa)||R(ab,aa)||J(ab,aa)||F(ab,aa)||x(ab,aa)||f(ab,aa)||K(ab,aa)||L(ab,aa)||i(ab,aa)||Z(ab,aa)||t(ab,aa)||I(ab,aa)||j(ab,aa)||X(ab,aa)||s(ab,aa)||y(ab,aa)||b(ab,aa)||Q(ab,aa)||g(ab,aa)||D(ab,aa)||E(ab,aa)||O(ab,aa)||h(ab,aa)||p(ab,aa)||w(ab,aa)||Y(ab,aa)||V(ab,aa)||A(ab,aa)||m(ab,aa)||B(ab,aa)||l(ab,aa)||d(ab,aa)||c(ab,aa)||G(ab,aa)||W(ab,aa)||o(ab,aa)||n(ab,aa)||v(ab,aa)||z(ab,aa);return ac===true?null:ac}return{startState:T,copyState:r,token:P}},"javascript","css","htmlmixed");a.defineMIME("text/x-pug","pug");a.defineMIME("text/x-jade","pug")});