function e(e){for(var t={},n=e.split(` `),r=0;r<n.length;++r)t[n[r]]=!0;return t}var t=`body catch class do else enum for foreach foreach_reverse if in interface mixin out scope struct switch try union unittest version while with`,n={keywords:e(`abstract alias align asm assert auto break case cast cdouble cent cfloat const continue debug default delegate delete deprecated export extern final finally function goto immutable import inout invariant is lazy macro module new nothrow override package pragma private protected public pure ref return shared short static super synchronized template this throw typedef typeid typeof volatile __FILE__ __LINE__ __gshared __traits __vector __parameters `+t),blockKeywords:e(t),builtin:e(`bool byte char creal dchar double float idouble ifloat int ireal long real short ubyte ucent uint ulong ushort wchar wstring void size_t sizediff_t`),atoms:e(`exit failure success true false null`),hooks:{"@":function(e,t){return e.eatWhile(/[\w\$_]/),`meta`}}},r=n.statementIndentUnit,i=n.keywords,a=n.builtin,o=n.blockKeywords,s=n.atoms,c=n.hooks,l=n.multiLineStrings,u=/[+\-*&%=<>!?|\/]/,d;function f(e,t){var n=e.next();if(c[n]){var r=c[n](e,t);if(r!==!1)return r}if(n==`"`||n==`'`||n=="`")return t.tokenize=p(n),t.tokenize(e,t);if(/[\[\]{}\(\),;\:\.]/.test(n))return d=n,null;if(/\d/.test(n))return e.eatWhile(/[\w\.]/),`number`;if(n==`/`){if(e.eat(`+`))return t.tokenize=h,h(e,t);if(e.eat(`*`))return t.tokenize=m,m(e,t);if(e.eat(`/`))return e.skipToEnd(),`comment`}if(u.test(n))return e.eatWhile(u),`operator`;e.eatWhile(/[\w\$_\xa1-\uffff]/);var l=e.current();return i.propertyIsEnumerable(l)?(o.propertyIsEnumerable(l)&&(d=`newstatement`),`keyword`):a.propertyIsEnumerable(l)?(o.propertyIsEnumerable(l)&&(d=`newstatement`),`builtin`):s.propertyIsEnumerable(l)?`atom`:`variable`}function p(e){return function(t,n){for(var r=!1,i,a=!1;(i=t.next())!=null;){if(i==e&&!r){a=!0;break}r=!r&&i==`\\`}return(a||!(r||l))&&(n.tokenize=null),`string`}}function m(e,t){for(var n=!1,r;r=e.next();){if(r==`/`&&n){t.tokenize=null;break}n=r==`*`}return`comment`}function h(e,t){for(var n=!1,r;r=e.next();){if(r==`/`&&n){t.tokenize=null;break}n=r==`+`}return`comment`}function g(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function _(e,t,n){var r=e.indented;return e.context&&e.context.type==`statement`&&(r=e.context.indented),e.context=new g(r,t,n,null,e.context)}function v(e){var t=e.context.type;return(t==`)`||t==`]`||t==`}`)&&(e.indented=e.context.indented),e.context=e.context.prev}const y={name:`d`,startState:function(e){return{tokenize:null,context:new g(-e,0,`top`,!1),indented:0,startOfLine:!0}},token:function(e,t){var n=t.context;if(e.sol()&&(n.align??=!1,t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;d=null;var r=(t.tokenize||f)(e,t);if(r==`comment`||r==`meta`)return r;if(n.align??=!0,(d==`;`||d==`:`||d==`,`)&&n.type==`statement`)v(t);else if(d==`{`)_(t,e.column(),`}`);else if(d==`[`)_(t,e.column(),`]`);else if(d==`(`)_(t,e.column(),`)`);else if(d==`}`){for(;n.type==`statement`;)n=v(t);for(n.type==`}`&&(n=v(t));n.type==`statement`;)n=v(t)}else d==n.type?v(t):((n.type==`}`||n.type==`top`)&&d!=`;`||n.type==`statement`&&d==`newstatement`)&&_(t,e.column(),`statement`);return t.startOfLine=!1,r},indent:function(e,t,n){if(e.tokenize!=f&&e.tokenize!=null)return null;var i=e.context,a=t&&t.charAt(0);i.type==`statement`&&a==`}`&&(i=i.prev);var o=a==i.type;return i.type==`statement`?i.indented+(a==`{`?0:r||n.unit):i.align?i.column+(o?0:1):i.indented+(o?0:n.unit)},languageData:{indentOnInput:/^\s*[{}]$/,commentTokens:{line:`//`,block:{open:`/*`,close:`*/`}}}};export{y as d};