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