"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var u;function r(n,e){return u=e,n}function t(n,e){var l=n.next();if(l=="<"&&n.eat("!")){if(n.eatWhile(/[\-]/))return e.tokenize=o,o(n,e);if(n.eatWhile(/[\w]/))return r("keyword","doindent")}else{if(l=="<"&&n.eat("?"))return e.tokenize=k("meta","?>"),r("meta",l);if(l=="#"&&n.eatWhile(/[\w]/))return r("atom","tag");if(l=="|")return r("keyword","separator");if(l.match(/[\(\)\[\]\-\.,\+\?>]/))return r(null,l);if(l.match(/[\[\]]/))return r("rule",l);if(l=='"'||l=="'")return e.tokenize=a(l),e.tokenize(n,e);if(n.eatWhile(/[a-zA-Z\?\+\d]/)){var i=n.current();return i.substr(i.length-1,i.length).match(/\?|\+/)!==null&&n.backUp(1),r("tag","tag")}else return l=="%"||l=="*"?r("number","number"):(n.eatWhile(/[\w\\\-_%.{,]/),r(null,null))}}function o(n,e){for(var l=0,i;(i=n.next())!=null;){if(l>=2&&i==">"){e.tokenize=t;break}l=i=="-"?l+1:0}return r("comment","comment")}function a(n){return function(e,l){for(var i=!1,c;(c=e.next())!=null;){if(c==n&&!i){l.tokenize=t;break}i=!i&&c=="\\"}return r("string","tag")}}function k(n,e){return function(l,i){for(;!l.eol();){if(l.match(e)){i.tokenize=t;break}l.next()}return n}}const f={name:"dtd",startState:function(){return{tokenize:t,baseIndent:0,stack:[]}},token:function(n,e){if(n.eatSpace())return null;var l=e.tokenize(n,e),i=e.stack[e.stack.length-1];return n.current()=="["||u==="doindent"||u=="["?e.stack.push("rule"):u==="endtag"?e.stack[e.stack.length-1]="endtag":n.current()=="]"||u=="]"||u==">"&&i=="rule"?e.stack.pop():u=="["&&e.stack.push("["),l},indent:function(n,e,l){var i=n.stack.length;return e.charAt(0)==="]"?i--:e.substr(e.length-1,e.length)===">"&&(e.substr(0,1)==="<"||u=="doindent"&&e.length>1||(u=="doindent"?i--:u==">"&&e.length>1||u=="tag"&&e!==">"||(u=="tag"&&n.stack[n.stack.length-1]=="rule"?i--:u=="tag"?i++:e===">"&&n.stack[n.stack.length-1]=="rule"&&u===">"?i--:e===">"&&n.stack[n.stack.length-1]=="rule"||(e.substr(0,1)!=="<"&&e.substr(0,1)===">"?i=i-1:e===">"||(i=i-1)))),(u==null||u=="]")&&i--),n.baseIndent+i*l.unit},languageData:{indentOnInput:/^\s*[\]>]$/}};exports.dtd=f;
//# sourceMappingURL=dtd-ChoVQPwv.js.map
