var x=["-type","-spec","-export_type","-opaque"],S=["after","begin","catch","case","cond","end","fun","if","let","of","query","receive","try","when"],z=/[\->,;]/,W=["->",";",","],U=["and","andalso","band","bnot","bor","bsl","bsr","bxor","div","not","or","orelse","rem","xor"],A=/[\+\-\*\/<>=\|:!]/,E=["=","+","-","*","/",">",">=","<","=<","=:=","==","=/=","/=","||","<-","!"],Z=/[<\(\[\{]/,d=["<<","(","[","{"],q=/[>\)\]\}]/,y=["}","]",")",">>"],T=["is_atom","is_binary","is_bitstring","is_boolean","is_float","is_function","is_integer","is_list","is_number","is_pid","is_port","is_record","is_reference","is_tuple","atom","binary","bitstring","boolean","function","integer","list","number","pid","port","record","reference","tuple"],D=["abs","adler32","adler32_combine","alive","apply","atom_to_binary","atom_to_list","binary_to_atom","binary_to_existing_atom","binary_to_list","binary_to_term","bit_size","bitstring_to_list","byte_size","check_process_code","contact_binary","crc32","crc32_combine","date","decode_packet","delete_module","disconnect_node","element","erase","exit","float","float_to_list","garbage_collect","get","get_keys","group_leader","halt","hd","integer_to_list","internal_bif","iolist_size","iolist_to_binary","is_alive","is_atom","is_binary","is_bitstring","is_boolean","is_float","is_function","is_integer","is_list","is_number","is_pid","is_port","is_process_alive","is_record","is_reference","is_tuple","length","link","list_to_atom","list_to_binary","list_to_bitstring","list_to_existing_atom","list_to_float","list_to_integer","list_to_pid","list_to_tuple","load_module","make_ref","module_loaded","monitor_node","node","node_link","node_unlink","nodes","notalive","now","open_port","pid_to_list","port_close","port_command","port_connect","port_control","pre_loaded","process_flag","process_info","processes","purge_module","put","register","registered","round","self","setelement","size","spawn","spawn_link","spawn_monitor","spawn_opt","split_binary","statistics","term_to_binary","time","throw","tl","trunc","tuple_size","tuple_to_list","unlink","unregister","whereis"],f=/[\w@Ø-ÞÀ-Öß-öø-ÿ]/,N=/[0-7]{1,3}|[bdefnrstv\\"']|\^[a-zA-Z]|x[0-9a-zA-Z]{2}|x{[0-9a-zA-Z]+}/;function O(t,r){if(r.in_string)return r.in_string=!k(t),i(r,t,"string");if(r.in_atom)return r.in_atom=!h(t),i(r,t,"atom");if(t.eatSpace())return i(r,t,"whitespace");if(!_(r)&&t.match(/-\s*[a-zß-öø-ÿ][\wØ-ÞÀ-Öß-öø-ÿ]*/))return o(t.current(),x)?i(r,t,"type"):i(r,t,"attribute");var n=t.next();if(n=="%")return t.skipToEnd(),i(r,t,"comment");if(n==":")return i(r,t,"colon");if(n=="?")return t.eatSpace(),t.eatWhile(f),i(r,t,"macro");if(n=="#")return t.eatSpace(),t.eatWhile(f),i(r,t,"record");if(n=="$")return t.next()=="\\"&&!t.match(N)?i(r,t,"error"):i(r,t,"number");if(n==".")return i(r,t,"dot");if(n=="'"){if(!(r.in_atom=!h(t))){if(t.match(/\s*\/\s*[0-9]/,!1))return t.match(/\s*\/\s*[0-9]/,!0),i(r,t,"fun");if(t.match(/\s*\(/,!1)||t.match(/\s*:/,!1))return i(r,t,"function")}return i(r,t,"atom")}if(n=='"')return r.in_string=!k(t),i(r,t,"string");if(/[A-Z_Ø-ÞÀ-Ö]/.test(n))return t.eatWhile(f),i(r,t,"variable");if(/[a-z_ß-öø-ÿ]/.test(n)){if(t.eatWhile(f),t.match(/\s*\/\s*[0-9]/,!1))return t.match(/\s*\/\s*[0-9]/,!0),i(r,t,"fun");var e=t.current();return o(e,S)?i(r,t,"keyword"):o(e,U)?i(r,t,"operator"):t.match(/\s*\(/,!1)?o(e,D)&&(_(r).token!=":"||_(r,2).token=="erlang")?i(r,t,"builtin"):o(e,T)?i(r,t,"guard"):i(r,t,"function"):$(t)==":"?e=="erlang"?i(r,t,"builtin"):i(r,t,"function"):o(e,["true","false"])?i(r,t,"boolean"):i(r,t,"atom")}var c=/[0-9]/,a=/[0-9a-zA-Z]/;return c.test(n)?(t.eatWhile(c),t.eat("#")?t.eatWhile(a)||t.backUp(1):t.eat(".")&&(t.eatWhile(c)?t.eat(/[eE]/)&&(t.eat(/[-+]/)?t.eatWhile(c)||t.backUp(2):t.eatWhile(c)||t.backUp(1)):t.backUp(1)),i(r,t,"number")):b(t,Z,d)?i(r,t,"open_paren"):b(t,q,y)?i(r,t,"close_paren"):g(t,z,W)?i(r,t,"separator"):g(t,A,E)?i(r,t,"operator"):i(r,t,null)}function b(t,r,n){if(t.current().length==1&&r.test(t.current())){for(t.backUp(1);r.test(t.peek());)if(t.next(),o(t.current(),n))return!0;t.backUp(t.current().length-1)}return!1}function g(t,r,n){if(t.current().length==1&&r.test(t.current())){for(;r.test(t.peek());)t.next();for(;01&&t[r].type==="fun"&&t[r-1].token==="fun")return t.slice(0,r-1);switch(t[r].token){case"}":return s(t,{g:["{"]});case"]":return s(t,{i:["["]});case")":return s(t,{i:["("]});case">>":return s(t,{i:["<<"]});case"end":return s(t,{i:["begin","case","fun","if","receive","try"]});case",":return s(t,{e:["begin","try","when","->",",","(","[","{","<<"]});case"->":return s(t,{r:["when"],m:["try","if","case","receive"]});case";":return s(t,{E:["case","fun","if","receive","try","when"]});case"catch":return s(t,{e:["try"]});case"of":return s(t,{e:["case"]});case"after":return s(t,{e:["receive","try"]});default:return t}}function s(t,r){for(var n in r)for(var e=t.length-1,c=r[n],a=e-1;-1"?o(u.token,["receive","case","if","try"])?u.column+n.unit+n.unit:u.column+n.unit:o(a.token,d)?a.column+a.token.length:(e=Q(t),l(e)?e.column+n.unit:0):0}function I(t){var r=t.match(/,|[a-z]+|\}|\]|\)|>>|\|+|\(/);return l(r)&&r.index===0?r[0]:""}function P(t){var r=t.tokenStack.slice(0,-1),n=p(r,"type",["open_paren"]);return l(r[n])?r[n]:!1}function Q(t){var r=t.tokenStack,n=p(r,"type",["open_paren","separator","keyword"]),e=p(r,"type",["operator"]);return l(n)&&l(e)&&n