~webapps/webapps-documentation/quantal

« back to all changes in this revision

Viewing changes to sh_webidl.js

  • Committer: Robert Carr
  • Date: 2012-03-12 12:58:42 UTC
  • Revision ID: racarr@canonical.com-20120312125842-dycjkgwoesdkzb5b
Initial commit

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