MCPcopy Create free account
hub / github.com/TruthHun/BookStack / def

Function def

static/editor.md/lib/codemirror/mode/modelica/modelica.js:213–237  ·  view source on GitHub ↗
(mimes, mode)

Source from the content-addressed store, hash-verified

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",

Callers 1

modelica.jsFile · 0.70

Calls 1

addFunction · 0.70

Tested by

no test coverage detected