annotate runtime/syntax/lpc.vim @ 7467:765110dd332c v7.4.1036

commit https://github.com/vim/vim/commit/fa03fd6c4a9fe05274d62ddefd645cb5801d2023 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 2 22:03:00 2016 +0100 patch 7.4.1036 Problem: Only terminals with up to 256 colors work properly. Solution: Use the 256 color behavior for all terminals with 256 or more colors. (Robert de Bath, closes https://github.com/vim/vim/issues/504)
author Christian Brabandt <cb@256bit.org>
date Sat, 02 Jan 2016 22:15:04 +0100
parents 8b8ef1fed009
children 43efa4f5a8ea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: LPC
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Shizhu Pan <poet@mudbuilder.net>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 " URL: http://poet.tomud.com/pub/lpc.vim.bz2
3224
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
5 " Last Change: 2011 Dec 10 by Thilo Six
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " Comments: If you are using Vim 6.2 or later, see :h lpc.vim for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " file type recognizing, if not, you had to use modeline.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 " Nodule: This is the start nodule. {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19
3224
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
20 let s:cpo_save = &cpo
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
21 set cpo&vim
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
22
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 " Nodule: Keywords {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 " LPC keywords
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 " keywords should always be highlighted so "contained" is not used.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syn cluster lpcKeywdGrp contains=lpcConditional,lpcLabel,lpcOperator,lpcRepeat,lpcStatement,lpcModifier,lpcReserved
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 syn keyword lpcConditional if else switch
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 syn keyword lpcLabel case default
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn keyword lpcOperator catch efun in inherit
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 syn keyword lpcRepeat do for foreach while
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 syn keyword lpcStatement break continue return
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn match lpcEfunError /efun[^:]/ display
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 " Illegal to use keyword as function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 " It's not working, maybe in the next version.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 syn keyword lpcKeywdError contained if for foreach return switch while
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 " These are keywords only because they take lvalue or type as parameter,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 " so these keywords should only be used as function but cannot be names of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 " user-defined functions.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn keyword lpcKeywdFunc new parse_command sscanf time_expression
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 " Nodule: Type and modifiers {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 " Type names list.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 " Special types
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 syn keyword lpcType void mixed unknown
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 " Scalar/Value types.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 syn keyword lpcType int float string
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 " Pointer types.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 syn keyword lpcType array buffer class function mapping object
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 " Other types.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 if exists("lpc_compat_32")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 syn keyword lpcType closure status funcall
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 syn keyword lpcError closure status
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 syn keyword lpcType multiset
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 " Type modifier.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 syn keyword lpcModifier nomask private public
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 syn keyword lpcModifier varargs virtual
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 " sensible modifiers
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 if exists("lpc_pre_v22")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 syn keyword lpcReserved nosave protected ref
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 syn keyword lpcModifier static
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 syn keyword lpcError static
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 syn keyword lpcModifier nosave protected ref
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 " Nodule: Applies {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 " Match a function declaration or function pointer
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 syn match lpcApplyDecl excludenl /->\h\w*(/me=e-1 contains=lpcApplies transparent display
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 " We should note that in func_spec.c the efun definition syntax is so
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 " complicated that I use such a long regular expression to describe.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 syn match lpcLongDecl excludenl /\(\s\|\*\)\h\+\s\h\+(/me=e-1 contains=@lpcEfunGroup,lpcType,@lpcKeywdGrp transparent display
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 " this is form for all functions
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 " ->foo() form had been excluded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 syn match lpcFuncDecl excludenl /\h\w*(/me=e-1 contains=lpcApplies,@lpcEfunGroup,lpcKeywdError transparent display
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 " The (: :) parenthesis or $() forms a function pointer
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 syn match lpcFuncName /(:\s*\h\+\s*:)/me=e-1 contains=lpcApplies,@lpcEfunGroup transparent display contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 syn match lpcFuncName /(:\s*\h\+,/ contains=lpcApplies,@lpcEfunGroup transparent display contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 syn match lpcFuncName /\$(\h\+)/ contains=lpcApplies,@lpcEfunGroup transparent display contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 " Applies list.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 " system applies
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 syn keyword lpcApplies contained __INIT clean_up create destructor heart_beat id init move_or_destruct reset
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 " interactive
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 syn keyword lpcApplies contained catch_tell logon net_dead process_input receive_message receive_snoop telnet_suboption terminal_type window_size write_prompt
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 " master applies
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 syn keyword lpcApplies contained author_file compile_object connect crash creator_file domain_file epilog error_handler flag get_bb_uid get_root_uid get_save_file_name log_error make_path_absolute object_name preload privs_file retrieve_ed_setup save_ed_setup slow_shutdown
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 syn keyword lpcApplies contained valid_asm valid_bind valid_compile_to_c valid_database valid_hide valid_link valid_object valid_override valid_read valid_save_binary valid_seteuid valid_shadow valid_socket valid_write
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 " parsing
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 syn keyword lpcApplies contained inventory_accessible inventory_visible is_living parse_command_adjectiv_id_list parse_command_adjective_id_list parse_command_all_word parse_command_id_list parse_command_plural_id_list parse_command_prepos_list parse_command_users parse_get_environment parse_get_first_inventory parse_get_next_inventory parser_error_message
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 " Nodule: Efuns {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 syn cluster lpcEfunGroup contains=lpc_efuns,lpcOldEfuns,lpcNewEfuns,lpcKeywdFunc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 " Compat32 efuns
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 if exists("lpc_compat_32")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 syn keyword lpc_efuns contained closurep heart_beat_info m_delete m_values m_indices query_once_interactive strstr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 syn match lpcErrFunc /#`\h\w*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 " Shell compatible first line comment.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 syn region lpcCommentFunc start=/^#!/ end=/$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 " pre-v22 efuns which are removed in newer versions.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 syn keyword lpcOldEfuns contained tail dump_socket_status
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 " new efuns after v22 should be added here!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 syn keyword lpcNewEfuns contained socket_status
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 " LPC efuns list.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 " DEBUG efuns Not included.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 " New efuns should NOT be added to this list, see v22 efuns above.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 " Efuns list {{{2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 syn keyword lpc_efuns contained acos add_action all_inventory all_previous_objects allocate allocate_buffer allocate_mapping apply arrayp asin atan author_stats
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 syn keyword lpc_efuns contained bind break_string bufferp
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 syn keyword lpc_efuns contained cache_stats call_other call_out call_out_info call_stack capitalize catch ceil check_memory children classp clear_bit clone_object clonep command commands copy cos cp crc32 crypt ctime
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 syn keyword lpc_efuns contained db_close db_commit db_connect db_exec db_fetch db_rollback db_status debug_info debugmalloc debug_message deep_inherit_list deep_inventory destruct disable_commands disable_wizard domain_stats dumpallobj dump_file_descriptors dump_prog
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134 syn keyword lpc_efuns contained each ed ed_cmd ed_start enable_commands enable_wizard environment error errorp eval_cost evaluate exec exp explode export_uid external_start
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 syn keyword lpc_efuns contained fetch_variable file_length file_name file_size filter filter_array filter_mapping find_call_out find_living find_object find_player first_inventory floatp floor flush_messages function_exists function_owner function_profile functionp functions
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136 syn keyword lpc_efuns contained generate_source get_char get_config get_dir geteuid getuid
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 syn keyword lpc_efuns contained heart_beats
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 syn keyword lpc_efuns contained id_matrix implode in_edit in_input inherit_list inherits input_to interactive intp
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 syn keyword lpc_efuns contained keys
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140 syn keyword lpc_efuns contained link living livings load_object localtime log log10 lookat_rotate lower_case lpc_info
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141 syn keyword lpc_efuns contained malloc_check malloc_debug malloc_status map map_array map_delete map_mapping mapp master match_path max_eval_cost member_array memory_info memory_summary message mkdir moncontrol move_object mud_status
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 syn keyword lpc_efuns contained named_livings network_stats next_bit next_inventory notify_fail nullp
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143 syn keyword lpc_efuns contained objectp objects oldcrypt opcprof origin
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144 syn keyword lpc_efuns contained parse_add_rule parse_add_synonym parse_command parse_dump parse_init parse_my_rules parse_refresh parse_remove parse_sentence pluralize pointerp pow present previous_object printf process_string process_value program_info
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145 syn keyword lpc_efuns contained query_ed_mode query_heart_beat query_host_name query_idle query_ip_name query_ip_number query_ip_port query_load_average query_notify_fail query_privs query_replaced_program query_shadowing query_snoop query_snooping query_verb
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146 syn keyword lpc_efuns contained random read_buffer read_bytes read_file receive reclaim_objects refs regexp reg_assoc reload_object remove_action remove_call_out remove_interactive remove_shadow rename repeat_string replace_program replace_string replaceable reset_eval_cost resolve restore_object restore_variable rm rmdir rotate_x rotate_y rotate_z rusage
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147 syn keyword lpc_efuns contained save_object save_variable say scale set_author set_bit set_eval_limit set_heart_beat set_hide set_light set_living_name set_malloc_mask set_privs set_reset set_this_player set_this_user seteuid shadow shallow_inherit_list shout shutdown sin sizeof snoop socket_accept socket_acquire socket_address socket_bind socket_close socket_connect socket_create socket_error socket_listen socket_release socket_write sort_array sprintf sqrt stat store_variable strcmp stringp strlen strsrch
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 syn keyword lpc_efuns contained tan tell_object tell_room terminal_colour test_bit this_interactive this_object this_player this_user throw time to_float to_int trace traceprefix translate typeof
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149 syn keyword lpc_efuns contained undefinedp unique_array unique_mapping upper_case uptime userp users
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150 syn keyword lpc_efuns contained values variables virtualp
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151 syn keyword lpc_efuns contained wizardp write write_buffer write_bytes write_file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153 " Nodule: Constants {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155 " LPC Constants.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156 " like keywords, constants are always highlighted, be careful to choose only
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 " the constants we used to add to this list.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158 syn keyword lpcConstant __ARCH__ __COMPILER__ __DIR__ __FILE__ __OPTIMIZATION__ __PORT__ __VERSION__
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159 " Defines in options.h are all predefined in LPC sources surrounding by
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160 " two underscores. Do we need to include all of that?
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161 syn keyword lpcConstant __SAVE_EXTENSION__ __HEARTBEAT_INTERVAL__
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162 " from the documentation we know that these constants remains only for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163 " backward compatibility and should not be used any more.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164 syn keyword lpcConstant HAS_ED HAS_PRINTF HAS_RUSAGE HAS_DEBUG_LEVEL
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165 syn keyword lpcConstant MUD_NAME F__THIS_OBJECT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 " Nodule: Todo for this file. {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169 " TODO : need to check for LPC4 syntax and other series of LPC besides
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
170 " v22, b21 and l32, if you had a good idea, contact me at poet@mudbuilder.net
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
171 " and I will be appreciated about that.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
172
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
173 " Notes about some FAQ:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175 " About variables : We adopts the same behavior for C because almost all the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
176 " LPC programmers are also C programmers, so we don't need separate settings
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
177 " for C and LPC. That is the reason why I don't change variables like
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
178 " "c_no_utf"s to "lpc_no_utf"s.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
179 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
180 " Copy : Some of the following seems to be copied from c.vim but not quite
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
181 " the same in details because the syntax for C and LPC is different.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
182 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
183 " Color scheme : this syntax file had been thouroughly tested to work well
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
184 " for all of the dark-backgrounded color schemes Vim has provided officially,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
185 " and it should be quite Ok for all of the bright-backgrounded color schemes,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
186 " of course it works best for the color scheme that I am using, download it
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
187 " from http://poet.tomud.com/pub/ps_color.vim.bz2 if you want to try it.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
188 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
189
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
190 " Nodule: String and Character {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
191
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
192
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
193 " String and Character constants
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
194 " Highlight special characters (those which have a backslash) differently
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
195 syn match lpcSpecial display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
196 if !exists("c_no_utf")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
197 syn match lpcSpecial display contained "\\\(u\x\{4}\|U\x\{8}\)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
198 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
199
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
200 " LPC version of sprintf() format,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
201 syn match lpcFormat display "%\(\d\+\)\=[-+ |=#@:.]*\(\d\+\)\=\('\I\+'\|'\I*\\'\I*'\)\=[OsdicoxXf]" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
202 syn match lpcFormat display "%%" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
203 syn region lpcString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=lpcSpecial,lpcFormat
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
204 " lpcCppString: same as lpcString, but ends at end of line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
205 syn region lpcCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=lpcSpecial,lpcFormat
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
206
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
207 " LPC preprocessor for the text formatting short cuts
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
208 " Thanks to Dr. Charles E. Campbell <cec@gryphon.gsfc.nasa.gov>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209 " he suggests the best way to do this.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
210 syn region lpcTextString start=/@\z(\h\w*\)$/ end=/^\z1/ contains=lpcSpecial
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
211 syn region lpcArrayString start=/@@\z(\h\w*\)$/ end=/^\z1/ contains=lpcSpecial
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
212
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
213 " Character
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
214 syn match lpcCharacter "L\='[^\\]'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
215 syn match lpcCharacter "L'[^']*'" contains=lpcSpecial
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
216 syn match lpcSpecialError "L\='\\[^'\"?\\abefnrtv]'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217 syn match lpcSpecialCharacter "L\='\\['\"?\\abefnrtv]'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
218 syn match lpcSpecialCharacter display "L\='\\\o\{1,3}'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
219 syn match lpcSpecialCharacter display "'\\x\x\{1,2}'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
220 syn match lpcSpecialCharacter display "L'\\x\x\+'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
221
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
222 " Nodule: White space {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
223
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
224 " when wanted, highlight trailing white space
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
225 if exists("c_space_errors")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
226 if !exists("c_no_trail_space_error")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
227 syn match lpcSpaceError display excludenl "\s\+$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
228 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
229 if !exists("c_no_tab_space_error")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
230 syn match lpcSpaceError display " \+\t"me=e-1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
231 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
232 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
233
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
234 " Nodule: Parenthesis and brackets {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
235
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
236 " catch errors caused by wrong parenthesis and brackets
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
237 syn cluster lpcParenGroup contains=lpcParenError,lpcIncluded,lpcSpecial,lpcCommentSkip,lpcCommentString,lpcComment2String,@lpcCommentGroup,lpcCommentStartError,lpcUserCont,lpcUserLabel,lpcBitField,lpcCommentSkip,lpcOctalZero,lpcCppOut,lpcCppOut2,lpcCppSkip,lpcFormat,lpcNumber,lpcFloat,lpcOctal,lpcOctalError,lpcNumbersCom
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
238 syn region lpcParen transparent start='(' end=')' contains=ALLBUT,@lpcParenGroup,lpcCppParen,lpcErrInBracket,lpcCppBracket,lpcCppString,@lpcEfunGroup,lpcApplies,lpcKeywdError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
239 " lpcCppParen: same as lpcParen but ends at end-of-line; used in lpcDefine
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
240 syn region lpcCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@lpcParenGroup,lpcErrInBracket,lpcParen,lpcBracket,lpcString,@lpcEfunGroup,lpcApplies,lpcKeywdError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
241 syn match lpcParenError display ")"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
242 syn match lpcParenError display "\]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
243 " for LPC:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
244 " Here we should consider the array ({ }) parenthesis and mapping ([ ])
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
245 " parenthesis and multiset (< >) parenthesis.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
246 syn match lpcErrInParen display contained "[^^]{"ms=s+1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
247 syn match lpcErrInParen display contained "\(}\|\]\)[^)]"me=e-1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
248 syn region lpcBracket transparent start='\[' end=']' contains=ALLBUT,@lpcParenGroup,lpcErrInParen,lpcCppParen,lpcCppBracket,lpcCppString,@lpcEfunGroup,lpcApplies,lpcFuncName,lpcKeywdError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
249 " lpcCppBracket: same as lpcParen but ends at end-of-line; used in lpcDefine
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
250 syn region lpcCppBracket transparent start='\[' skip='\\$' excludenl end=']' end='$' contained contains=ALLBUT,@lpcParenGroup,lpcErrInParen,lpcParen,lpcBracket,lpcString,@lpcEfunGroup,lpcApplies,lpcFuncName,lpcKeywdError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
251 syn match lpcErrInBracket display contained "[);{}]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
252
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
253 " Nodule: Numbers {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
254
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
255 " integer number, or floating point number without a dot and with "f".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
256 syn case ignore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
257 syn match lpcNumbers display transparent "\<\d\|\.\d" contains=lpcNumber,lpcFloat,lpcOctalError,lpcOctal
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
258 " Same, but without octal error (for comments)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
259 syn match lpcNumbersCom display contained transparent "\<\d\|\.\d" contains=lpcNumber,lpcFloat,lpcOctal
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
260 syn match lpcNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
261 " hex number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
262 syn match lpcNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
263 " Flag the first zero of an octal number as something special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
264 syn match lpcOctal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=lpcOctalZero
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
265 syn match lpcOctalZero display contained "\<0"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
266 syn match lpcFloat display contained "\d\+f"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
267 " floating point number, with dot, optional exponent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
268 syn match lpcFloat display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
269 " floating point number, starting with a dot, optional exponent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
270 syn match lpcFloat display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
271 " floating point number, without dot, with exponent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
272 syn match lpcFloat display contained "\d\+e[-+]\=\d\+[fl]\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
273 " flag an octal number with wrong digits
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
274 syn match lpcOctalError display contained "0\o*[89]\d*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
275 syn case match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
276
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
277 " Nodule: Comment string {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
278
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
279 " lpcCommentGroup allows adding matches for special things in comments
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
280 syn keyword lpcTodo contained TODO FIXME XXX
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
281 syn cluster lpcCommentGroup contains=lpcTodo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
282
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
283 if exists("c_comment_strings")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
284 " A comment can contain lpcString, lpcCharacter and lpcNumber.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
285 syntax match lpcCommentSkip contained "^\s*\*\($\|\s\+\)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
286 syntax region lpcCommentString contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=lpcSpecial,lpcCommentSkip
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
287 syntax region lpcComment2String contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=lpcSpecial
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
288 syntax region lpcCommentL start="//" skip="\\$" end="$" keepend contains=@lpcCommentGroup,lpcComment2String,lpcCharacter,lpcNumbersCom,lpcSpaceError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
289 syntax region lpcComment matchgroup=lpcCommentStart start="/\*" matchgroup=NONE end="\*/" contains=@lpcCommentGroup,lpcCommentStartError,lpcCommentString,lpcCharacter,lpcNumbersCom,lpcSpaceError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
290 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
291 syn region lpcCommentL start="//" skip="\\$" end="$" keepend contains=@lpcCommentGroup,lpcSpaceError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
292 syn region lpcComment matchgroup=lpcCommentStart start="/\*" matchgroup=NONE end="\*/" contains=@lpcCommentGroup,lpcCommentStartError,lpcSpaceError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
293 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
294 " keep a // comment separately, it terminates a preproc. conditional
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
295 syntax match lpcCommentError display "\*/"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
296 syntax match lpcCommentStartError display "/\*"me=e-1 contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
297
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
298 " Nodule: Pre-processor {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
299
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
300 syn region lpcPreCondit start="^\s*#\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" end="//"me=s-1 contains=lpcComment,lpcCppString,lpcCharacter,lpcCppParen,lpcParenError,lpcNumbers,lpcCommentError,lpcSpaceError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
301 syn match lpcPreCondit display "^\s*#\s*\(else\|endif\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
302 if !exists("c_no_if0")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
303 syn region lpcCppOut start="^\s*#\s*if\s\+0\+\>" end=".\|$" contains=lpcCppOut2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
304 syn region lpcCppOut2 contained start="0" end="^\s*#\s*\(endif\>\|else\>\|elif\>\)" contains=lpcSpaceError,lpcCppSkip
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
305 syn region lpcCppSkip contained start="^\s*#\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*#\s*endif\>" contains=lpcSpaceError,lpcCppSkip
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
306 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
307 syn region lpcIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
308 syn match lpcIncluded display contained "<[^>]*>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
309 syn match lpcInclude display "^\s*#\s*include\>\s*["<]" contains=lpcIncluded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
310 syn match lpcLineSkip "\\$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
311 syn cluster lpcPreProcGroup contains=lpcPreCondit,lpcIncluded,lpcInclude,lpcDefine,lpcErrInParen,lpcErrInBracket,lpcUserLabel,lpcSpecial,lpcOctalZero,lpcCppOut,lpcCppOut2,lpcCppSkip,lpcFormat,lpcNumber,lpcFloat,lpcOctal,lpcOctalError,lpcNumbersCom,lpcString,lpcCommentSkip,lpcCommentString,lpcComment2String,@lpcCommentGroup,lpcCommentStartError,lpcParen,lpcBracket,lpcMulti,lpcKeywdError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
312 syn region lpcDefine start="^\s*#\s*\(define\|undef\)\>" skip="\\$" end="$" end="//"me=s-1 contains=ALLBUT,@lpcPreProcGroup
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
313
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
314 if exists("lpc_pre_v22")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
315 syn region lpcPreProc start="^\s*#\s*\(pragma\>\|echo\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@lpcPreProcGroup
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
316 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
317 syn region lpcPreProc start="^\s*#\s*\(pragma\>\|echo\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@lpcPreProcGroup
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
318 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
319
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
320 " Nodule: User labels {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
321
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
322 " Highlight Labels
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
323 " User labels in LPC is not allowed, only "case x" and "default" is supported
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
324 syn cluster lpcMultiGroup contains=lpcIncluded,lpcSpecial,lpcCommentSkip,lpcCommentString,lpcComment2String,@lpcCommentGroup,lpcCommentStartError,lpcUserCont,lpcUserLabel,lpcBitField,lpcOctalZero,lpcCppOut,lpcCppOut2,lpcCppSkip,lpcFormat,lpcNumber,lpcFloat,lpcOctal,lpcOctalError,lpcNumbersCom,lpcCppParen,lpcCppBracket,lpcCppString,lpcKeywdError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
325 syn region lpcMulti transparent start='\(case\|default\|public\|protected\|private\)' skip='::' end=':' contains=ALLBUT,@lpcMultiGroup
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
326
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
327 syn cluster lpcLabelGroup contains=lpcUserLabel
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
328 syn match lpcUserCont display "^\s*lpc:$" contains=@lpcLabelGroup
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
329
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
330 " Don't want to match anything
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
331 syn match lpcUserLabel display "lpc" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
332
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
333 " Nodule: Initializations {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
334
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
335 if exists("c_minlines")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
336 let b:c_minlines = c_minlines
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
337 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
338 if !exists("c_no_if0")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
339 let b:c_minlines = 50 " #if 0 constructs can be long
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
340 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
341 let b:c_minlines = 15 " mostly for () constructs
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
342 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
343 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
344 exec "syn sync ccomment lpcComment minlines=" . b:c_minlines
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
345
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
346 " Make sure these options take place since we no longer depend on file type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
347 " plugin for C
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
348 setlocal cindent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
349 setlocal fo-=t fo+=croql
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
350 setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
351
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
352 " Win32 can filter files in the browse dialog
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
353 if has("gui_win32") && !exists("b:browsefilter")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
354 let b:browsefilter = "LPC Source Files (*.c *.d *.h)\t*.c;*.d;*.h\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
355 \ "LPC Data Files (*.scr *.o *.dat)\t*.scr;*.o;*.dat\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
356 \ "Text Documentation (*.txt)\t*.txt\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
357 \ "All Files (*.*)\t*.*\n"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
358 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
359
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
360 " Nodule: Highlight links {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
361
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
362 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
363 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
364 " For version 5.8 and later: only when an item doesn't have highlighting yet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
365 if version >= 508 || !exists("did_lpc_syn_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
366 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
367 let did_lpc_syn_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
368 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
369 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
370 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
371 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
372
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
373 HiLink lpcModifier lpcStorageClass
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
374
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
375 HiLink lpcQuotedFmt lpcFormat
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
376 HiLink lpcFormat lpcSpecial
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
377 HiLink lpcCppString lpcString " Cpp means
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
378 " C Pre-Processor
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
379 HiLink lpcCommentL lpcComment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
380 HiLink lpcCommentStart lpcComment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
381 HiLink lpcUserLabel lpcLabel
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
382 HiLink lpcSpecialCharacter lpcSpecial
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
383 HiLink lpcOctal lpcPreProc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
384 HiLink lpcOctalZero lpcSpecial " LPC will treat octal numbers
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
385 " as decimals, programmers should
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
386 " be aware of that.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
387 HiLink lpcEfunError lpcError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
388 HiLink lpcKeywdError lpcError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
389 HiLink lpcOctalError lpcError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
390 HiLink lpcParenError lpcError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
391 HiLink lpcErrInParen lpcError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
392 HiLink lpcErrInBracket lpcError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
393 HiLink lpcCommentError lpcError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
394 HiLink lpcCommentStartError lpcError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
395 HiLink lpcSpaceError lpcError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
396 HiLink lpcSpecialError lpcError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
397 HiLink lpcErrFunc lpcError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
398
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
399 if exists("lpc_pre_v22")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
400 HiLink lpcOldEfuns lpc_efuns
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
401 HiLink lpcNewEfuns lpcError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
402 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
403 HiLink lpcOldEfuns lpcReserved
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
404 HiLink lpcNewEfuns lpc_efuns
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
405 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
406 HiLink lpc_efuns lpcFunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
407
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
408 HiLink lpcReserved lpcPreProc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
409 HiLink lpcTextString lpcString " This should be preprocessors, but
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
410 HiLink lpcArrayString lpcPreProc " let's make some difference
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
411 " between text and array
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
412
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
413 HiLink lpcIncluded lpcString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
414 HiLink lpcCommentString lpcString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
415 HiLink lpcComment2String lpcString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
416 HiLink lpcCommentSkip lpcComment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
417 HiLink lpcCommentFunc lpcComment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
418
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
419 HiLink lpcCppSkip lpcCppOut
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
420 HiLink lpcCppOut2 lpcCppOut
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
421 HiLink lpcCppOut lpcComment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
422
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
423 " Standard type below
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
424 HiLink lpcApplies Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
425 HiLink lpcCharacter Character
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
426 HiLink lpcComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
427 HiLink lpcConditional Conditional
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
428 HiLink lpcConstant Constant
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
429 HiLink lpcDefine Macro
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
430 HiLink lpcError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
431 HiLink lpcFloat Float
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
432 HiLink lpcFunction Function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
433 HiLink lpcIdentifier Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
434 HiLink lpcInclude Include
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
435 HiLink lpcLabel Label
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
436 HiLink lpcNumber Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
437 HiLink lpcOperator Operator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
438 HiLink lpcPreCondit PreCondit
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
439 HiLink lpcPreProc PreProc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
440 HiLink lpcRepeat Repeat
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
441 HiLink lpcStatement Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
442 HiLink lpcStorageClass StorageClass
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
443 HiLink lpcString String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
444 HiLink lpcStructure Structure
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
445 HiLink lpcSpecial LineNr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
446 HiLink lpcTodo Todo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
447 HiLink lpcType Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
448
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
449 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
450 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
451
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
452 " Nodule: This is the end nodule. {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
453
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
454 let b:current_syntax = "lpc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
455
3224
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
456 let &cpo = s:cpo_save
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
457 unlet s:cpo_save
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
458
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
459 " vim:ts=8:nosta:sw=2:ai:si:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
460 " vim600:set fdm=marker: }}}1