diff options
author | mitsuhiko <devnull@localhost> | 2008-05-07 12:13:20 +0200 |
---|---|---|
committer | mitsuhiko <devnull@localhost> | 2008-05-07 12:13:20 +0200 |
commit | 8fd8882818a020d8e5b39bb7ca31297ade34dd41 (patch) | |
tree | d892db85a59b363d63471883652ad22943e9b9ff /pygments/lexers/functional.py | |
parent | 78f23152429c3c09c7721c38a49d1df6c0ec4bc0 (diff) | |
parent | bea7b882efa3e67cf6b5e9e38fa55f15c7eb7e26 (diff) | |
download | pygments-8fd8882818a020d8e5b39bb7ca31297ade34dd41.tar.gz |
Automated merge with ssh://team@pocoo.org/pygments-main
Diffstat (limited to 'pygments/lexers/functional.py')
-rw-r--r-- | pygments/lexers/functional.py | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/pygments/lexers/functional.py b/pygments/lexers/functional.py index c2305f68..a7a50f7d 100644 --- a/pygments/lexers/functional.py +++ b/pygments/lexers/functional.py @@ -627,6 +627,36 @@ class ErlangLexer(RegexLexer): 'let', 'of', 'query', 'receive', 'try', 'when', ] + builtins = [ # See erlang(3) man page + 'abs', 'append_element', 'apply', 'atom_to_list', 'binary_to_list', + 'bitstring_to_list', 'binary_to_term', 'bit_size', 'bump_reductions', + 'byte_size', 'cancel_timer', 'check_process_code', 'delete_module', + 'demonitor', 'disconnect_node', 'display', 'element', 'erase', 'exit', + 'float', 'float_to_list', 'fun_info', 'fun_to_list', + 'function_exported', 'garbage_collect', 'get', 'get_keys', + 'group_leader', 'hash', 'hd', 'integer_to_list', 'iolist_to_binary', + 'iolist_size', 'is_atom', 'is_binary', 'is_bitstring', 'is_boolean', + 'is_builtin', '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', 'localtime_to_universaltime', 'make_tuple', 'md5', + 'md5_final', 'md5_update', 'memory', 'module_loaded', 'monitor', + 'monitor_node', 'node', 'nodes', 'open_port', 'phash', 'phash2', + 'pid_to_list', 'port_close', 'port_command', 'port_connect', + 'port_control', 'port_call', 'port_info', 'port_to_list', + 'process_display', 'process_flag', 'process_info', 'purge_module', + 'put', 'read_timer', 'ref_to_list', 'register', 'resume_process', + 'round', 'send', 'send_after', 'send_nosuspend', 'set_cookie', + 'setelement', 'size', 'spawn', 'spawn_link', 'spawn_monitor', + 'spawn_opt', 'split_binary', 'start_timer', 'statistics', + 'suspend_process', 'system_flag', 'system_info', 'system_monitor', + 'system_profile', 'term_to_binary', 'tl', 'trace', 'trace_delivered', + 'trace_info', 'trace_pattern', 'trunc', 'tuple_size', 'tuple_to_list', + 'universaltime_to_localtime', 'unlink', 'unregister', 'whereis' + ] + operators = r'(\+|-|\*|/|<|>|=|==|/=|=:=|=/=|=<|>=|\+\+|--|<-|!)' word_operators = [ 'and', 'andalso', 'band', 'bnot', 'bor', 'bsl', 'bsr', 'bxor', @@ -647,8 +677,9 @@ class ErlangLexer(RegexLexer): 'root': [ (r'\s+', Text), (r'%.*\n', Comment), - ('|'.join(keywords), Name.Keyword), - (r'\b(?:'+'|'.join(word_operators)+r')\b', Operator.Word), + ('(' + '|'.join(keywords) + r')\b', Keyword), + ('(' + '|'.join(builtins) + r')\b', Name.Builtin), + ('(' + '|'.join(word_operators) + r')\b', Operator.Word), (r'^-', Punctuation, 'directive'), (operators, Operator), (r'"', String, 'string'), |