~ubuntu-branches/ubuntu/saucy/keystone/saucy-proposed

« back to all changes in this revision

Viewing changes to keystone/content/common/js/shjs/sh_javascript.js

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2011-08-23 10:18:22 UTC
  • Revision ID: james.westby@ubuntu.com-20110823101822-enve6zceb3lqhuvj
Tags: upstream-1.0~d4~20110823.1078
ImportĀ upstreamĀ versionĀ 1.0~d4~20110823.1078

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
if (! this.sh_languages) {
 
2
  this.sh_languages = {};
 
3
}
 
4
sh_languages['javascript'] = [
 
5
  [
 
6
    [
 
7
      /\/\/\//g,
 
8
      'sh_comment',
 
9
      1
 
10
    ],
 
11
    [
 
12
      /\/\//g,
 
13
      'sh_comment',
 
14
      7
 
15
    ],
 
16
    [
 
17
      /\/\*\*/g,
 
18
      'sh_comment',
 
19
      8
 
20
    ],
 
21
    [
 
22
      /\/\*/g,
 
23
      'sh_comment',
 
24
      9
 
25
    ],
 
26
    [
 
27
      /\b(?:abstract|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|final|finally|for|function|goto|if|implements|in|instanceof|interface|native|new|null|private|protected|prototype|public|return|static|super|switch|synchronized|throw|throws|this|transient|true|try|typeof|var|volatile|while|with)\b/g,
 
28
      'sh_keyword',
 
29
      -1
 
30
    ],
 
31
    [
 
32
      /(\+\+|--|\)|\])(\s*)(\/=?(?![*\/]))/g,
 
33
      ['sh_symbol', 'sh_normal', 'sh_symbol'],
 
34
      -1
 
35
    ],
 
36
    [
 
37
      /(0x[A-Fa-f0-9]+|(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?)(\s*)(\/(?![*\/]))/g,
 
38
      ['sh_number', 'sh_normal', 'sh_symbol'],
 
39
      -1
 
40
    ],
 
41
    [
 
42
      /([A-Za-z$_][A-Za-z0-9$_]*\s*)(\/=?(?![*\/]))/g,
 
43
      ['sh_normal', 'sh_symbol'],
 
44
      -1
 
45
    ],
 
46
    [
 
47
      /\/(?:\\.|[^*\\\/])(?:\\.|[^\\\/])*\/[gim]*/g,
 
48
      'sh_regexp',
 
49
      -1
 
50
    ],
 
51
    [
 
52
      /\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,
 
53
      'sh_number',
 
54
      -1
 
55
    ],
 
56
    [
 
57
      /"/g,
 
58
      'sh_string',
 
59
      10
 
60
    ],
 
61
    [
 
62
      /'/g,
 
63
      'sh_string',
 
64
      11
 
65
    ],
 
66
    [
 
67
      /~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,
 
68
      'sh_symbol',
 
69
      -1
 
70
    ],
 
71
    [
 
72
      /\{|\}/g,
 
73
      'sh_cbracket',
 
74
      -1
 
75
    ],
 
76
    [
 
77
      /\b(?:Math|Infinity|NaN|undefined|arguments)\b/g,
 
78
      'sh_predef_var',
 
79
      -1
 
80
    ],
 
81
    [
 
82
      /\b(?:Array|Boolean|Date|Error|EvalError|Function|Number|Object|RangeError|ReferenceError|RegExp|String|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt)\b/g,
 
83
      'sh_predef_func',
 
84
      -1
 
85
    ],
 
86
    [
 
87
      /(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,
 
88
      'sh_function',
 
89
      -1
 
90
    ]
 
91
  ],
 
92
  [
 
93
    [
 
94
      /$/g,
 
95
      null,
 
96
      -2
 
97
    ],
 
98
    [
 
99
      /(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,
 
100
      'sh_url',
 
101
      -1
 
102
    ],
 
103
    [
 
104
      /<\?xml/g,
 
105
      'sh_preproc',
 
106
      2,
 
107
      1
 
108
    ],
 
109
    [
 
110
      /<!DOCTYPE/g,
 
111
      'sh_preproc',
 
112
      4,
 
113
      1
 
114
    ],
 
115
    [
 
116
      /<!--/g,
 
117
      'sh_comment',
 
118
      5
 
119
    ],
 
120
    [
 
121
      /<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,
 
122
      'sh_keyword',
 
123
      -1
 
124
    ],
 
125
    [
 
126
      /<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,
 
127
      'sh_keyword',
 
128
      6,
 
129
      1
 
130
    ],
 
131
    [
 
132
      /&(?:[A-Za-z0-9]+);/g,
 
133
      'sh_preproc',
 
134
      -1
 
135
    ],
 
136
    [
 
137
      /<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,
 
138
      'sh_keyword',
 
139
      -1
 
140
    ],
 
141
    [
 
142
      /<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,
 
143
      'sh_keyword',
 
144
      6,
 
145
      1
 
146
    ],
 
147
    [
 
148
      /@[A-Za-z]+/g,
 
149
      'sh_type',
 
150
      -1
 
151
    ],
 
152
    [
 
153
      /(?:TODO|FIXME|BUG)(?:[:]?)/g,
 
154
      'sh_todo',
 
155
      -1
 
156
    ]
 
157
  ],
 
158
  [
 
159
    [
 
160
      /\?>/g,
 
161
      'sh_preproc',
 
162
      -2
 
163
    ],
 
164
    [
 
165
      /([^=" \t>]+)([ \t]*)(=?)/g,
 
166
      ['sh_type', 'sh_normal', 'sh_symbol'],
 
167
      -1
 
168
    ],
 
169
    [
 
170
      /"/g,
 
171
      'sh_string',
 
172
      3
 
173
    ]
 
174
  ],
 
175
  [
 
176
    [
 
177
      /\\(?:\\|")/g,
 
178
      null,
 
179
      -1
 
180
    ],
 
181
    [
 
182
      /"/g,
 
183
      'sh_string',
 
184
      -2
 
185
    ]
 
186
  ],
 
187
  [
 
188
    [
 
189
      />/g,
 
190
      'sh_preproc',
 
191
      -2
 
192
    ],
 
193
    [
 
194
      /([^=" \t>]+)([ \t]*)(=?)/g,
 
195
      ['sh_type', 'sh_normal', 'sh_symbol'],
 
196
      -1
 
197
    ],
 
198
    [
 
199
      /"/g,
 
200
      'sh_string',
 
201
      3
 
202
    ]
 
203
  ],
 
204
  [
 
205
    [
 
206
      /-->/g,
 
207
      'sh_comment',
 
208
      -2
 
209
    ],
 
210
    [
 
211
      /<!--/g,
 
212
      'sh_comment',
 
213
      5
 
214
    ]
 
215
  ],
 
216
  [
 
217
    [
 
218
      /(?:\/)?>/g,
 
219
      'sh_keyword',
 
220
      -2
 
221
    ],
 
222
    [
 
223
      /([^=" \t>]+)([ \t]*)(=?)/g,
 
224
      ['sh_type', 'sh_normal', 'sh_symbol'],
 
225
      -1
 
226
    ],
 
227
    [
 
228
      /"/g,
 
229
      'sh_string',
 
230
      3
 
231
    ]
 
232
  ],
 
233
  [
 
234
    [
 
235
      /$/g,
 
236
      null,
 
237
      -2
 
238
    ]
 
239
  ],
 
240
  [
 
241
    [
 
242
      /\*\//g,
 
243
      'sh_comment',
 
244
      -2
 
245
    ],
 
246
    [
 
247
      /(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,
 
248
      'sh_url',
 
249
      -1
 
250
    ],
 
251
    [
 
252
      /<\?xml/g,
 
253
      'sh_preproc',
 
254
      2,
 
255
      1
 
256
    ],
 
257
    [
 
258
      /<!DOCTYPE/g,
 
259
      'sh_preproc',
 
260
      4,
 
261
      1
 
262
    ],
 
263
    [
 
264
      /<!--/g,
 
265
      'sh_comment',
 
266
      5
 
267
    ],
 
268
    [
 
269
      /<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,
 
270
      'sh_keyword',
 
271
      -1
 
272
    ],
 
273
    [
 
274
      /<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,
 
275
      'sh_keyword',
 
276
      6,
 
277
      1
 
278
    ],
 
279
    [
 
280
      /&(?:[A-Za-z0-9]+);/g,
 
281
      'sh_preproc',
 
282
      -1
 
283
    ],
 
284
    [
 
285
      /<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,
 
286
      'sh_keyword',
 
287
      -1
 
288
    ],
 
289
    [
 
290
      /<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,
 
291
      'sh_keyword',
 
292
      6,
 
293
      1
 
294
    ],
 
295
    [
 
296
      /@[A-Za-z]+/g,
 
297
      'sh_type',
 
298
      -1
 
299
    ],
 
300
    [
 
301
      /(?:TODO|FIXME|BUG)(?:[:]?)/g,
 
302
      'sh_todo',
 
303
      -1
 
304
    ]
 
305
  ],
 
306
  [
 
307
    [
 
308
      /\*\//g,
 
309
      'sh_comment',
 
310
      -2
 
311
    ],
 
312
    [
 
313
      /(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,
 
314
      'sh_url',
 
315
      -1
 
316
    ],
 
317
    [
 
318
      /(?:TODO|FIXME|BUG)(?:[:]?)/g,
 
319
      'sh_todo',
 
320
      -1
 
321
    ]
 
322
  ],
 
323
  [
 
324
    [
 
325
      /"/g,
 
326
      'sh_string',
 
327
      -2
 
328
    ],
 
329
    [
 
330
      /\\./g,
 
331
      'sh_specialchar',
 
332
      -1
 
333
    ]
 
334
  ],
 
335
  [
 
336
    [
 
337
      /'/g,
 
338
      'sh_string',
 
339
      -2
 
340
    ],
 
341
    [
 
342
      /\\./g,
 
343
      'sh_specialchar',
 
344
      -1
 
345
    ]
 
346
  ]
 
347
];