function words(str){for(var obj={},words2=str.split(" "),i=0;i<words2.length;++i)obj[words2[i]]=!0;return obj}var pBuiltins="ABS ACOS ARITY ASIN ATAN AVG BAGSIZE BINSTORAGE BLOOM BUILDBLOOM CBRT CEIL CONCAT COR COS COSH COUNT COUNT_STAR COV CONSTANTSIZE CUBEDIMENSIONS DIFF DISTINCT DOUBLEABS DOUBLEAVG DOUBLEBASE DOUBLEMAX DOUBLEMIN DOUBLEROUND DOUBLESUM EXP FLOOR FLOATABS FLOATAVG FLOATMAX FLOATMIN FLOATROUND FLOATSUM GENERICINVOKER INDEXOF INTABS INTAVG INTMAX INTMIN INTSUM INVOKEFORDOUBLE INVOKEFORFLOAT INVOKEFORINT INVOKEFORLONG INVOKEFORSTRING INVOKER ISEMPTY JSONLOADER JSONMETADATA JSONSTORAGE LAST_INDEX_OF LCFIRST LOG LOG10 LOWER LONGABS LONGAVG LONGMAX LONGMIN LONGSUM MAX MIN MAPSIZE MONITOREDUDF NONDETERMINISTIC OUTPUTSCHEMA  PIGSTORAGE PIGSTREAMING RANDOM REGEX_EXTRACT REGEX_EXTRACT_ALL REPLACE ROUND SIN SINH SIZE SQRT STRSPLIT SUBSTRING SUM STRINGCONCAT STRINGMAX STRINGMIN STRINGSIZE TAN TANH TOBAG TOKENIZE TOMAP TOP TOTUPLE TRIM TEXTLOADER TUPLESIZE UCFIRST UPPER UTF8STORAGECONVERTER ",pKeywords="VOID IMPORT RETURNS DEFINE LOAD FILTER FOREACH ORDER CUBE DISTINCT COGROUP JOIN CROSS UNION SPLIT INTO IF OTHERWISE ALL AS BY USING INNER OUTER ONSCHEMA PARALLEL PARTITION GROUP AND OR NOT GENERATE FLATTEN ASC DESC IS STREAM THROUGH STORE MAPREDUCE SHIP CACHE INPUT OUTPUT STDERROR STDIN STDOUT LIMIT SAMPLE LEFT RIGHT FULL EQ GT LT GTE LTE NEQ MATCHES TRUE FALSE DUMP",pTypes="BOOLEAN INT LONG FLOAT DOUBLE CHARARRAY BYTEARRAY BAG TUPLE MAP ",builtins=words(pBuiltins),keywords=words(pKeywords),types=words(pTypes),isOperatorChar=/[*+\-%<>=&?:\/!|]/;function chain(stream,state,f){return state.tokenize=f,f(stream,state)}function tokenComment(stream,state){for(var ch,isEnd=!1;ch=stream.next();){if("/"==ch&&isEnd){state.tokenize=tokenBase;break}isEnd="*"==ch}return"comment"}function tokenBase(stream,state){var quote,ch=stream.next();return'"'==ch||"'"==ch?chain(stream,state,(quote=ch,function(stream,state){for(var next,escaped=!1,end=!1;null!=(next=stream.next());){if(next==quote&&!escaped){end=!0;break}escaped=!escaped&&"\\"==next}return!end&&escaped||(state.tokenize=tokenBase),"error"})):/[\[\]{}\(\),;\.]/.test(ch)?null:/\d/.test(ch)?(stream.eatWhile(/[\w\.]/),"number"):"/"==ch?stream.eat("*")?chain(stream,state,tokenComment):(stream.eatWhile(isOperatorChar),"operator"):"-"==ch?stream.eat("-")?(stream.skipToEnd(),"comment"):(stream.eatWhile(isOperatorChar),"operator"):isOperatorChar.test(ch)?(stream.eatWhile(isOperatorChar),"operator"):(stream.eatWhile(/[\w\$_]/),keywords&&keywords.propertyIsEnumerable(stream.current().toUpperCase())&&!stream.eat(")")&&!stream.eat(".")?"keyword":builtins&&builtins.propertyIsEnumerable(stream.current().toUpperCase())?"builtin":types&&types.propertyIsEnumerable(stream.current().toUpperCase())?"type":"variable")}const pig={name:"pig",startState:function(){return{tokenize:tokenBase,startOfLine:!0}},token:function(stream,state){return stream.eatSpace()?null:state.tokenize(stream,state)},languageData:{autocomplete:(pBuiltins+pTypes+pKeywords).split(" ")}};export{pig};
