var curPunc,keywords={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},atoms={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},isOperatorChar=/[+\-*&^%:=<>!|\/]/;function tokenBase(t,e){var n=t.next();if('"'==n||"'"==n||"`"==n)return e.tokenize=tokenString(n),e.tokenize(t,e);if(/[\d\.]/.test(n))return "."==n?t.match(/^[0-9]+([eE][\-+]?[0-9]+)?/):"0"==n?t.match(/^[xX][0-9a-fA-F]+/)||t.match(/^0[0-7]+/):t.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/),"number";if(/[\[\]{}\(\),;\:\.]/.test(n))return curPunc=n,null;if("/"==n){if(t.eat("*"))return e.tokenize=tokenComment,tokenComment(t,e);if(t.eat("/"))return t.skipToEnd(),"comment"}if(isOperatorChar.test(n))return t.eatWhile(isOperatorChar),"operator";t.eatWhile(/[\w\$_\xa1-\uffff]/);var r=t.current();return keywords.propertyIsEnumerable(r)?("case"!=r&&"default"!=r||(curPunc="case"),"keyword"):atoms.propertyIsEnumerable(r)?"atom":"variable"}function tokenString(t){return function(e,n){for(var r,o=!1,i=!1;null!=(r=e.next());){if(r==t&&!o){i=!0;break}o=!o&&"`"!=t&&"\\"==r;}return (i||!o&&"`"!=t)&&(n.tokenize=tokenBase),"string"}}function tokenComment(t,e){for(var n,r=!1;n=t.next();){if("/"==n&&r){e.tokenize=tokenBase;break}r="*"==n;}return "comment"}function Context(t,e,n,r,o){this.indented=t,this.column=e,this.type=n,this.align=r,this.prev=o;}function pushContext(t,e,n){return t.context=new Context(t.indented,e,n,null,t.context)}function popContext(t){if(t.context.prev){var e=t.context.type;return ")"!=e&&"]"!=e&&"}"!=e||(t.indented=t.context.indented),t.context=t.context.prev}}const go={startState:function(t){return {tokenize:null,context:new Context(-t,0,"top",!1),indented:0,startOfLine:!0}},token:function(t,e){var n=e.context;if(t.sol()&&(null==n.align&&(n.align=!1),e.indented=t.indentation(),e.startOfLine=!0,"case"==n.type&&(n.type="}")),t.eatSpace())return null;curPunc=null;var r=(e.tokenize||tokenBase)(t,e);return "comment"==r||(null==n.align&&(n.align=!0),"{"==curPunc?pushContext(e,t.column(),"}"):"["==curPunc?pushContext(e,t.column(),"]"):"("==curPunc?pushContext(e,t.column(),")"):"case"==curPunc?n.type="case":("}"==curPunc&&"}"==n.type||curPunc==n.type)&&popContext(e),e.startOfLine=!1),r},indent:function(t,e,n){if(t.tokenize!=tokenBase&&null!=t.tokenize)return null;var r=t.context,o=e&&e.charAt(0);if("case"==r.type&&/^(?:case|default)\b/.test(e))return t.context.type="}",r.indented;var i=o==r.type;return r.align?r.column+(i?0:1):r.indented+(i?0:n.unit)},languageData:{indentOnInput:/^\s([{}]|case |default\s*:)$/,commentTokens:{line:"//",block:{open:"/*",close:"*/"}}}};

export { go };
