Ticket #1408: erlang.syntax

File erlang.syntax, 7.9 KB (added by baryluk, 15 years ago)
Line 
1# -------------------------------
2#
3# Erlang programming language syntax highlighting
4# for CoolEdit
5#
6# Homepage of Erlang: http://www.erlang.org
7#
8# Author: Witold Baryluk < baryluk at smp if uj edu pl >
9# Date: 07-07-2009
10#
11# -------------------------------
12#
13# Usefull links:
14# http://www.erlang.org/doc/doc-5.4.13/doc/reference_manual/part_frame.html
15# http://www.regular-expressions.info/reference.html
16# gedit: http://martin.ankerl.com/files/erlang.lang
17# joe: http://www.straatinvestments.com/~tlack/erlang/joe-editor/erlang.jsf
18# geshi: http://www.kreisquadratur.de/blog/?p=305
19# vim: http://erlang.org/pipermail/erlang-questions/2006-July/021362.html
20# kate: http://bugsfiles.kde.org/attachment.cgi?id=21155
21
22context default
23        keyword whole after yellow
24        keyword whole and brown
25        keyword whole andalso brown
26        keyword whole band brown
27        keyword whole begin yellow
28        keyword whole bnot brown
29        keyword whole bor brown
30        keyword whole bsl brown
31        keyword whole bsr brown
32        keyword whole bxor brown
33        keyword whole case yellow
34        keyword whole catch yellow
35        keyword whole cond yellow
36        keyword whole div brown
37        keyword whole end yellow
38        keyword whole fun yellow
39        keyword whole if yellow
40        keyword whole let yellow
41        keyword whole not brown
42        keyword whole of yellow
43        keyword whole or brown
44        keyword whole orelse brown
45        keyword whole query yellow
46        keyword whole receive yellow
47        keyword whole rem brown
48        keyword whole try yellow
49        keyword whole throw yellow
50        keyword whole xor brown
51
52        keyword whole when yellow
53
54        keyword whole -module brightmagenta
55        keyword whole -compile brightmagenta
56        keyword whole -behaviour brightmagenta
57        keyword whole -record brightmagenta
58        keyword whole -define brightmagenta
59        keyword whole -include brightmagenta
60        keyword whole -include_lib brightmagenta
61        keyword whole -vsn magenta
62        keyword whole -author magenta
63        keyword whole -copyright magenta
64        keyword whole -export brightmagenta
65        keyword whole -\{abcdefghijklmnoprqstuvwxyz\}\[abcdefghijklmnoprqstuvwxyzABCDEFGHIJKLMNOPRQSTVWXYZ0123456789_\] red
66
67# erlang:*
68        keyword whole abs brightgreen
69        keyword whole accept brightgreen
70        keyword whole alarm brightgreen
71        keyword whole apply brightgreen
72        keyword whole atom_to_list brightgreen
73        keyword whole binary_to_list brightgreen
74        keyword whole binary_to_term brightgreen
75        keyword whole check_process_code brightgreen
76        keyword whole concat_binary brightgreen
77        keyword whole date brightgreen
78        keyword whole delete_module brightgreen
79        keyword whole disconnect_node brightgreen
80        keyword whole element brightgreen
81        keyword whole erase brightgreen
82        keyword whole exit brightgreen
83        keyword whole float brightgreen
84        keyword whole float_to_list brightgreen
85        keyword whole garbage_collect brightgreen
86        keyword whole get brightgreen
87        keyword whole get_keys brightgreen
88        keyword whole group_leader brightgreen
89        keyword whole halt brightgreen
90        keyword whole hd brightgreen
91        keyword whole integer_to_list brightgreen
92        keyword whole is_alive brightgreen
93        keyword whole is_atom brightgreen
94        keyword whole is_binary brightgreen
95        keyword whole is_boolean brightgreen
96        keyword whole is_float brightgreen
97        keyword whole is_function brightgreen
98        keyword whole is_integer brightgreen
99        keyword whole is_list brightgreen
100        keyword whole is_number brightgreen
101        keyword whole is_pid brightgreen
102        keyword whole is_port brightgreen
103        keyword whole is_process_alive brightgreen
104        keyword whole is_record brightgreen
105        keyword whole is_reference brightgreen
106        keyword whole is_tuple brightgreen
107        keyword whole length brightgreen
108        keyword whole link brightgreen
109        keyword whole list_to_atom brightgreen
110        keyword whole list_to_binary brightgreen
111        keyword whole list_to_float brightgreen
112        keyword whole list_to_integer brightgreen
113        keyword whole list_to_pid brightgreen
114        keyword whole list_to_tuple brightgreen
115        keyword whole load_module brightgreen
116        keyword whole loaded brightgreen
117        keyword whole localtime brightgreen
118        keyword whole make_ref brightgreen
119        keyword whole module_loaded brightgreen
120        keyword whole node brightgreen
121        keyword whole nodes brightgreen
122        keyword whole now brightgreen
123        keyword whole open_port brightgreen
124        keyword whole pid_to_list brightgreen
125        keyword whole port_close brightgreen
126        keyword whole port_command brightgreen
127        keyword whole port_connect brightgreen
128        keyword whole port_control brightgreen
129        keyword whole ports brightgreen
130        keyword whole pre_loaded brightgreen
131        keyword whole process_flag brightgreen
132        keyword whole process_info brightgreen
133        keyword whole processes brightgreen
134        keyword whole purge_module brightgreen
135        keyword whole put brightgreen
136        keyword whole register brightgreen
137        keyword whole registered brightgreen
138        keyword whole round brightgreen
139        keyword whole self brightgreen
140        keyword whole setelement brightgreen
141        keyword whole size brightgreen
142        keyword whole spawn brightgreen
143        keyword whole spawn_link brightgreen
144        keyword whole spawn_opt brightgreen
145        keyword whole split_binary brightgreen
146        keyword whole statistics brightgreen
147        keyword whole term_to_binary brightgreen
148        keyword whole throw brightgreen
149        keyword whole time brightgreen
150        keyword whole tl brightgreen
151        keyword whole trunc brightgreen
152        keyword whole tuple_to_list brightgreen
153        keyword whole unlink brightgreen
154        keyword whole unregister brightgreen
155        keyword whole whereis brightgreen
156
157        keyword whole gen_server:cast brightgreen
158        keyword whole gen_server:call brightgreen
159        keyword whole gen_server:reply brightgreen
160        keyword whole gen_server:start_link brightgreen
161        keyword whole gen_server:start brightgreen
162        keyword whole io:format brightgreen
163
164        keyword whole init white
165        keyword whole handle_cast white
166        keyword whole handle_call white
167        keyword whole handle_info white
168        keyword whole handle_event white
169        keyword whole handle_sync_event white
170        keyword whole terminate white
171        keyword whole code_change white
172
173# list comprehension
174        keyword <- yellow
175# clause
176        keyword -> yellow
177# guards
178        keyword =:= brown
179        keyword == brown
180        keyword /= brown
181        keyword =/= brown
182# binary
183        keyword << brightcyan
184        keyword >> brightcyan
185# guards
186        keyword < brown
187        keyword =< brown
188        keyword >= brown
189        keyword > brown
190# ops
191        keyword - yellow
192        keyword \+ yellow
193        keyword / yellow
194        keyword \* yellow
195
196        keyword ; brightcyan
197        keyword , brightcyan
198        keyword . brightcyan
199        keyword = yellow
200        keyword % brown
201
202        keyword \+\+ yellow
203        keyword -- yellow
204        keyword ! yellow
205# TODO this does not work for $" or $', use $\" or $\' instead. ?
206        keyword $\{abcdefghijklmnoprqstuvwxyzABCDEFGHIJKLMNOPRQSTUVWXYZ0123456789_{}[]()(\\/`~!@#$%^&\*+-=;:'"|,./?<>\} red
207        keyword $\ red
208
209#       keyword '\\\{0123\}\{01234567\}\{01234567\}' brightgreen
210
211# TODO: integers, inegers of form Base#digits, 2#1010101
212# todo: records access via #state{}
213
214        keyword whole ?MODULE red
215        keyword whole ?LINE red
216        keyword whole ?FILE red
217        keyword whole ?\[abcdefghijklmnoprqstuvwxyzABCDEFGHIJKLMNOPRQSTUVWXYZ0123456789_@\] red
218
219# gray operatory
220# cyan - moduly
221
222
223        keyword whole true red
224        keyword whole false red
225
226        keyword [ brightcyan
227        keyword || brightcyan
228        keyword | brightcyan
229        keyword ] brightcyan
230        keyword ( brightcyan
231        keyword ) brightcyan
232        keyword { cyan
233        keyword } cyan
234
235        keyword whole lists:seq gray
236        keyword whole lists:map gray
237        keyword whole lists:filter gray
238        keyword whole lists:reduce gray
239        keyword whole lists:foldl gray
240        keyword whole lists:append gray
241        keyword whole lists:nth gray
242        keyword whole behaviour_info gray
243        keyword whole dict:find gray
244        keyword whole dict:is_key gray
245        keyword whole dict:erase gray
246        keyword whole dict:new gray
247        keyword whole dict:map gray
248        keyword whole dict:store gray
249        keyword whole dict:fetch_keys gray
250        keyword whole dict:append gray
251        keyword whole dict:update gray
252
253# todo: no more than one dot in atom, and not at the end
254        keyword whole \{abcdefghijklmnoprqstuvwxyz\}\[abcdefghijklmnoprqstuvwxyzABCDEFGHIJKLMNOPRQSTUVWXYZ0123456789_.@\] lightgray
255        keyword whole \{_ABCDEFGHIJKLMNOPRQSTUVWXYZ\}\[abcdefghijklmnoprqstuvwxyzABCDEFGHIJKLMNOPRQSTUVWXYZ0123456789_@\] white
256
257context exclusive % \n brown
258        spellcheck
259
260context " " green
261        spellcheck
262        keyword ~p brightgreen
263        keyword ~n brightgreen
264        keyword ~w brightgreen
265        keyword ~~ brightgreen
266
267context ' ' red
268        spellcheck