function failFirstLine(r,t){return r.skipToEnd(),t.cur=header,"error"}function start(r,t){return r.match(/^HTTP\/\d\.\d/)?(t.cur=responseStatusCode,"keyword"):r.match(/^[A-Z]+/)&&/[ \t]/.test(r.peek())?(t.cur=requestPath,"keyword"):failFirstLine(r,t)}function responseStatusCode(r,t){var e=r.match(/^\d+/);if(!e)return failFirstLine(r,t);t.cur=responseStatusText;var n=Number(e[0]);return n>=100&&n<400?"atom":"error"}function responseStatusText(r,t){return r.skipToEnd(),t.cur=header,null}function requestPath(r,t){return r.eatWhile(/\S/),t.cur=requestProtocol,"string.special"}function requestProtocol(r,t){return r.match(/^HTTP\/\d\.\d$/)?(t.cur=header,"keyword"):failFirstLine(r,t)}function header(r){return r.sol()&&!r.eat(/[ \t]/)?r.match(/^.*?:/)?"atom":(r.skipToEnd(),"error"):(r.skipToEnd(),"string")}function body(r){return r.skipToEnd(),null}const http={token:function(r,t){var e=t.cur;return e!=header&&e!=body&&r.eatSpace()?null:e(r,t)},blankLine:function(r){r.cur=body;},startState:function(){return {cur:start}}};

export { http };
