| 211 | var modelicaAtoms = "Real Boolean Integer String"; |
| 212 | |
| 213 | function def(mimes, mode) { |
| 214 | if (typeof mimes == "string") |
| 215 | mimes = [mimes]; |
| 216 | |
| 217 | var words = []; |
| 218 | |
| 219 | function add(obj) { |
| 220 | if (obj) |
| 221 | for (var prop in obj) |
| 222 | if (obj.hasOwnProperty(prop)) |
| 223 | words.push(prop); |
| 224 | } |
| 225 | |
| 226 | add(mode.keywords); |
| 227 | add(mode.builtin); |
| 228 | add(mode.atoms); |
| 229 | |
| 230 | if (words.length) { |
| 231 | mode.helperType = mimes[0]; |
| 232 | CodeMirror.registerHelper("hintWords", mimes[0], words); |
| 233 | } |
| 234 | |
| 235 | for (var i=0; i<mimes.length; ++i) |
| 236 | CodeMirror.defineMIME(mimes[i], mode); |
| 237 | } |
| 238 | |
| 239 | def(["text/x-modelica"], { |
| 240 | name: "modelica", |