var e={break:!0,case:!0,chan:!0,const:!0,continue:!0,default:!0,defer:!0,else:!0,fallthrough:!0,for:!0,func:!0,go:!0,goto:!0,if:!0,import:!0,interface:!0,map:!0,package:!0,range:!0,return:!0,select:!0,struct:!0,switch:!0,type:!0,var:!0,bool:!0,byte:!0,complex64:!0,complex128:!0,float32:!0,float64:!0,int8:!0,int16:!0,int32:!0,int64:!0,string:!0,uint8:!0,uint16:!0,uint32:!0,uint64:!0,int:!0,uint:!0,uintptr:!0,error:!0,rune:!0,any:!0,comparable:!0},t={true:!0,false:!0,iota:!0,nil:!0,append:!0,cap:!0,close:!0,complex:!0,copy:!0,delete:!0,imag:!0,len:!0,make:!0,new:!0,panic:!0,print:!0,println:!0,real:!0,recover:!0},n=/[+\-*&^%:=<>!|\/]/,r;function i(i,s){var c=i.next();if(c==`"`||c==`'`||c=="`")return s.tokenize=a(c),s.tokenize(i,s);if(/[\d\.]/.test(c))return c==`.`?i.match(/^[0-9]+([eE][\-+]?[0-9]+)?/):c==`0`?i.match(/^[xX][0-9a-fA-F]+/)||i.match(/^0[0-7]+/):i.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/),`number`;if(/[\[\]{}\(\),;\:\.]/.test(c))return r=c,null;if(c==`/`){if(i.eat(`*`))return s.tokenize=o,o(i,s);if(i.eat(`/`))return i.skipToEnd(),`comment`}if(n.test(c))return i.eatWhile(n),`operator`;i.eatWhile(/[\w\$_\xa1-\uffff]/);var l=i.current();return e.propertyIsEnumerable(l)?((l==`case`||l==`default`)&&(r=`case`),`keyword`):t.propertyIsEnumerable(l)?`atom`:`variable`}function a(e){return function(t,n){for(var r=!1,a,o=!1;(a=t.next())!=null;){if(a==e&&!r){o=!0;break}r=!r&&e!="`"&&a==`\\`}return(o||!(r||e=="`"))&&(n.tokenize=i),`string`}}function o(e,t){for(var n=!1,r;r=e.next();){if(r==`/`&&n){t.tokenize=i;break}n=r==`*`}return`comment`}function s(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function c(e,t,n){return e.context=new s(e.indented,t,n,null,e.context)}function l(e){if(e.context.prev){var t=e.context.type;return(t==`)`||t==`]`||t==`}`)&&(e.indented=e.context.indented),e.context=e.context.prev}}var u={name:`go`,startState:function(e){return{tokenize:null,context:new s(-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,n.type==`case`&&(n.type=`}`)),e.eatSpace())return null;r=null;var a=(t.tokenize||i)(e,t);return a==`comment`?a:(n.align??=!0,r==`{`?c(t,e.column(),`}`):r==`[`?c(t,e.column(),`]`):r==`(`?c(t,e.column(),`)`):r==`case`?n.type=`case`:(r==`}`&&n.type==`}`||r==n.type)&&l(t),t.startOfLine=!1,a)},indent:function(e,t,n){if(e.tokenize!=i&&e.tokenize!=null)return null;var r=e.context,a=t&&t.charAt(0);if(r.type==`case`&&/^(?:case|default)\b/.test(t))return r.indented;var o=a==r.type;return r.align?r.column+ +!o:r.indented+(o?0:n.unit)},languageData:{indentOnInput:/^\s([{}]|case |default\s*:)$/,commentTokens:{line:`//`,block:{open:`/*`,close:`*/`}}}};export{u as go};