| 256 | } |
| 257 | |
| 258 | function def(mimes, mode) { |
| 259 | if (typeof mimes == "string") mimes = [mimes]; |
| 260 | var words = []; |
| 261 | function add(obj) { |
| 262 | if (obj) for (var prop in obj) if (obj.hasOwnProperty(prop)) |
| 263 | words.push(prop); |
| 264 | } |
| 265 | add(mode.keywords); |
| 266 | add(mode.builtin); |
| 267 | add(mode.atoms); |
| 268 | if (words.length) { |
| 269 | mode.helperType = mimes[0]; |
| 270 | CodeMirror.registerHelper("hintWords", mimes[0], words); |
| 271 | } |
| 272 | |
| 273 | for (var i = 0; i < mimes.length; ++i) |
| 274 | CodeMirror.defineMIME(mimes[i], mode); |
| 275 | } |
| 276 | |
| 277 | def(["text/x-csrc", "text/x-c", "text/x-chdr"], { |
| 278 | name: "clike", |