Chat window now opens with no messages inside.
[Assignment-Trapper.git] / sh_cpp.js
blob7b81bfdeb9c3c6d108a9cf9a0eeea8b8bcd41eee
1 if (! this.sh_languages) {
2   this.sh_languages = {};
4 sh_languages['cpp'] = [
5   [
6     [
7       /(\b(?:class|struct|typename))([ \t]+)([A-Za-z0-9_]+)/g,
8       ['sh_keyword', 'sh_normal', 'sh_classname'],
9       -1
10     ],
11     [
12       /\b(?:class|const_cast|delete|dynamic_cast|explicit|false|friend|inline|mutable|namespace|new|operator|private|protected|public|reinterpret_cast|static_cast|template|this|throw|true|try|typeid|typename|using|virtual)\b/g,
13       'sh_keyword',
14       -1
15     ],
16     [
17       /\/\/\//g,
18       'sh_comment',
19       1
20     ],
21     [
22       /\/\//g,
23       'sh_comment',
24       7
25     ],
26     [
27       /\/\*\*/g,
28       'sh_comment',
29       8
30     ],
31     [
32       /\/\*/g,
33       'sh_comment',
34       9
35     ],
36     [
37       /(\bstruct)([ \t]+)([A-Za-z0-9_]+)/g,
38       ['sh_keyword', 'sh_normal', 'sh_classname'],
39       -1
40     ],
41     [
42       /^[ \t]*#(?:[ \t]*include)/g,
43       'sh_preproc',
44       10,
45       1
46     ],
47     [
48       /^[ \t]*#(?:[ \t]*[A-Za-z0-9_]*)/g,
49       'sh_preproc',
50       -1
51     ],
52     [
53       /\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,
54       'sh_number',
55       -1
56     ],
57     [
58       /"/g,
59       'sh_string',
60       13
61     ],
62     [
63       /'/g,
64       'sh_string',
65       14
66     ],
67     [
68       /\b(?:__asm|__cdecl|__declspec|__export|__far16|__fastcall|__fortran|__import|__pascal|__rtti|__stdcall|_asm|_cdecl|__except|_export|_far16|_fastcall|__finally|_fortran|_import|_pascal|_stdcall|__thread|__try|asm|auto|break|case|catch|cdecl|const|continue|default|do|else|enum|extern|for|goto|if|pascal|register|return|sizeof|static|struct|switch|typedef|union|volatile|while)\b/g,
69       'sh_keyword',
70       -1
71     ],
72     [
73       /\b(?:bool|char|double|float|int|long|short|signed|unsigned|void|wchar_t)\b/g,
74       'sh_type',
75       -1
76     ],
77     [
78       /~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,
79       'sh_symbol',
80       -1
81     ],
82     [
83       /\{|\}/g,
84       'sh_cbracket',
85       -1
86     ],
87     [
88       /(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,
89       'sh_function',
90       -1
91     ],
92     [
93       /([A-Za-z](?:[^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]|[_])*)((?:<.*>)?)(\s+(?=[*&]*[A-Za-z][^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]*\s*[`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\[\]]+))/g,
94       ['sh_usertype', 'sh_usertype', 'sh_normal'],
95       -1
96     ]
97   ],
98   [
99     [
100       /$/g,
101       null,
102       -2
103     ],
104     [
105       /(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,
106       'sh_url',
107       -1
108     ],
109     [
110       /<\?xml/g,
111       'sh_preproc',
112       2,
113       1
114     ],
115     [
116       /<!DOCTYPE/g,
117       'sh_preproc',
118       4,
119       1
120     ],
121     [
122       /<!--/g,
123       'sh_comment',
124       5
125     ],
126     [
127       /<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,
128       'sh_keyword',
129       -1
130     ],
131     [
132       /<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,
133       'sh_keyword',
134       6,
135       1
136     ],
137     [
138       /&(?:[A-Za-z0-9]+);/g,
139       'sh_preproc',
140       -1
141     ],
142     [
143       /<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,
144       'sh_keyword',
145       -1
146     ],
147     [
148       /<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,
149       'sh_keyword',
150       6,
151       1
152     ],
153     [
154       /@[A-Za-z]+/g,
155       'sh_type',
156       -1
157     ],
158     [
159       /(?:TODO|FIXME|BUG)(?:[:]?)/g,
160       'sh_todo',
161       -1
162     ]
163   ],
164   [
165     [
166       /\?>/g,
167       'sh_preproc',
168       -2
169     ],
170     [
171       /([^=" \t>]+)([ \t]*)(=?)/g,
172       ['sh_type', 'sh_normal', 'sh_symbol'],
173       -1
174     ],
175     [
176       /"/g,
177       'sh_string',
178       3
179     ]
180   ],
181   [
182     [
183       /\\(?:\\|")/g,
184       null,
185       -1
186     ],
187     [
188       /"/g,
189       'sh_string',
190       -2
191     ]
192   ],
193   [
194     [
195       />/g,
196       'sh_preproc',
197       -2
198     ],
199     [
200       /([^=" \t>]+)([ \t]*)(=?)/g,
201       ['sh_type', 'sh_normal', 'sh_symbol'],
202       -1
203     ],
204     [
205       /"/g,
206       'sh_string',
207       3
208     ]
209   ],
210   [
211     [
212       /-->/g,
213       'sh_comment',
214       -2
215     ],
216     [
217       /<!--/g,
218       'sh_comment',
219       5
220     ]
221   ],
222   [
223     [
224       /(?:\/)?>/g,
225       'sh_keyword',
226       -2
227     ],
228     [
229       /([^=" \t>]+)([ \t]*)(=?)/g,
230       ['sh_type', 'sh_normal', 'sh_symbol'],
231       -1
232     ],
233     [
234       /"/g,
235       'sh_string',
236       3
237     ]
238   ],
239   [
240     [
241       /$/g,
242       null,
243       -2
244     ]
245   ],
246   [
247     [
248       /\*\//g,
249       'sh_comment',
250       -2
251     ],
252     [
253       /(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,
254       'sh_url',
255       -1
256     ],
257     [
258       /<\?xml/g,
259       'sh_preproc',
260       2,
261       1
262     ],
263     [
264       /<!DOCTYPE/g,
265       'sh_preproc',
266       4,
267       1
268     ],
269     [
270       /<!--/g,
271       'sh_comment',
272       5
273     ],
274     [
275       /<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,
276       'sh_keyword',
277       -1
278     ],
279     [
280       /<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,
281       'sh_keyword',
282       6,
283       1
284     ],
285     [
286       /&(?:[A-Za-z0-9]+);/g,
287       'sh_preproc',
288       -1
289     ],
290     [
291       /<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,
292       'sh_keyword',
293       -1
294     ],
295     [
296       /<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,
297       'sh_keyword',
298       6,
299       1
300     ],
301     [
302       /@[A-Za-z]+/g,
303       'sh_type',
304       -1
305     ],
306     [
307       /(?:TODO|FIXME|BUG)(?:[:]?)/g,
308       'sh_todo',
309       -1
310     ]
311   ],
312   [
313     [
314       /\*\//g,
315       'sh_comment',
316       -2
317     ],
318     [
319       /(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,
320       'sh_url',
321       -1
322     ],
323     [
324       /(?:TODO|FIXME|BUG)(?:[:]?)/g,
325       'sh_todo',
326       -1
327     ]
328   ],
329   [
330     [
331       /$/g,
332       null,
333       -2
334     ],
335     [
336       /</g,
337       'sh_string',
338       11
339     ],
340     [
341       /"/g,
342       'sh_string',
343       12
344     ],
345     [
346       /\/\/\//g,
347       'sh_comment',
348       1
349     ],
350     [
351       /\/\//g,
352       'sh_comment',
353       7
354     ],
355     [
356       /\/\*\*/g,
357       'sh_comment',
358       8
359     ],
360     [
361       /\/\*/g,
362       'sh_comment',
363       9
364     ]
365   ],
366   [
367     [
368       /$/g,
369       null,
370       -2
371     ],
372     [
373       />/g,
374       'sh_string',
375       -2
376     ]
377   ],
378   [
379     [
380       /$/g,
381       null,
382       -2
383     ],
384     [
385       /\\(?:\\|")/g,
386       null,
387       -1
388     ],
389     [
390       /"/g,
391       'sh_string',
392       -2
393     ]
394   ],
395   [
396     [
397       /"/g,
398       'sh_string',
399       -2
400     ],
401     [
402       /\\./g,
403       'sh_specialchar',
404       -1
405     ]
406   ],
407   [
408     [
409       /'/g,
410       'sh_string',
411       -2
412     ],
413     [
414       /\\./g,
415       'sh_specialchar',
416       -1
417     ]
418   ]