function wordObj(words){for(var o={},i=0,e=words.length;i<e;++i)o[words[i]]=!0;return o}var keywords=wordObj(["note","across","when","variant","until","unique","undefine","then","strip","select","retry","rescue","require","rename","reference","redefine","prefix","once","old","obsolete","loop","local","like","is","inspect","infix","include","if","frozen","from","external","export","ensure","end","elseif","else","do","creation","create","check","alias","agent","separate","invariant","inherit","indexing","feature","expanded","deferred","class","Void","True","Result","Precursor","False","Current","create","attached","detachable","as","and","implies","not","or"]),operators=wordObj([":=","and then","and","or","<<",">>"]);function tokenBase(stream,state){if(stream.eatSpace())return null;var quote,style,ch=stream.next();return'"'==ch||"'"==ch?function(newtok,stream,state){return state.tokenize.push(newtok),newtok(stream,state)}((quote=ch,style="string",function(stream,state){for(var ch,escaped=!1;null!=(ch=stream.next());){if(ch==quote&&!escaped){state.tokenize.pop();break}escaped=!escaped&&"%"==ch}return style}),stream,state):"-"==ch&&stream.eat("-")?(stream.skipToEnd(),"comment"):":"==ch&&stream.eat("=")?"operator":/[0-9]/.test(ch)?(stream.eatWhile(/[xXbBCc0-9\.]/),stream.eat(/[\?\!]/),"variable"):/[a-zA-Z_0-9]/.test(ch)?(stream.eatWhile(/[a-zA-Z_0-9]/),stream.eat(/[\?\!]/),"variable"):/[=+\-\/*^%<>~]/.test(ch)?(stream.eatWhile(/[=+\-\/*^%<>~]/),"operator"):null}const eiffel={name:"eiffel",startState:function(){return{tokenize:[tokenBase]}},token:function(stream,state){var style=state.tokenize[state.tokenize.length-1](stream,state);if("variable"==style){var word=stream.current();style=keywords.propertyIsEnumerable(stream.current())?"keyword":operators.propertyIsEnumerable(stream.current())?"operator":/^[A-Z][A-Z_0-9]*$/g.test(word)?"tag":/^0[bB][0-1]+$/g.test(word)||/^0[cC][0-7]+$/g.test(word)||/^0[xX][a-fA-F0-9]+$/g.test(word)||/^([0-9]+\.[0-9]*)|([0-9]*\.[0-9]+)$/g.test(word)||/^[0-9]+$/g.test(word)?"number":"variable"}return style},languageData:{commentTokens:{line:"--"}}};export{eiffel};
