var M="builtin",e="comment",C="string",D="atom",G="number",n="keyword",i="header",B="def",t="link";function L(E){for(var T={},I=E.split(" "),R=0;R >= "),N={digit:/\d/,digit_or_colon:/[\d:]/,hex:/[0-9a-f]/i,sign:/[+-]/,exponent:/e/i,keyword_char:/[^\s\(\[\;\)\]]/,symbol:/[\w*+\-]/};function F(E,T){return E==="0"&&T.eat(/x/i)?(T.eatWhile(N.hex),!0):((E=="+"||E=="-")&&N.digit.test(T.peek())&&(T.eat(N.sign),E=T.next()),N.digit.test(E)?(T.eat(E),T.eatWhile(N.digit),T.peek()=="."&&(T.eat("."),T.eatWhile(N.digit)),T.eat(N.exponent)&&(T.eat(N.sign),T.eatWhile(N.digit)),!0):!1)}const Y={name:"cobol",startState:function(){return{indentStack:null,indentation:0,mode:!1}},token:function(E,T){if(T.indentStack==null&&E.sol()&&(T.indentation=6),E.eatSpace())return null;var I=null;switch(T.mode){case"string":for(var R=!1;(R=E.next())!=null;)if((R=='"'||R=="'")&&!E.match(/['"]/,!1)){T.mode=!1;break}I=C;break;default:var O=E.next(),A=E.column();if(A>=0&&A<=5)I=B;else if(A>=72&&A<=79)E.skipToEnd(),I=i;else if(O=="*"&&A==6)E.skipToEnd(),I=e;else if(O=='"'||O=="'")T.mode="string",I=C;else if(O=="'"&&!N.digit_or_colon.test(E.peek()))I=D;else if(O==".")I=t;else if(F(O,E))I=G;else{if(E.current().match(N.symbol))for(;A<71&&E.eat(N.symbol)!==void 0;)A++;U&&U.propertyIsEnumerable(E.current().toUpperCase())?I=n:P&&P.propertyIsEnumerable(E.current().toUpperCase())?I=M:S&&S.propertyIsEnumerable(E.current().toUpperCase())?I=D:I=null}}return I},indent:function(E){return E.indentStack==null?E.indentation:E.indentStack.indent}};export{Y as cobol};