!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(h){"use strict";function e(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}h.defineMode("modelica",function(e,t){var r=e.indentUnit,o=t.keywords||{},i=t.builtin||{},l=t.atoms||{},a=/[;=\(:\),{}.*<>+\-\/^\[\]]/,u=/(:=|<=|>=|==|<>|\.\+|\.\-|\.\*|\.\/|\.\^)/,s=/[0-9]/,c=/[_a-zA-Z]/;function f(e,t){return e.skipToEnd(),t.tokenize=null,"comment"}function p(e,t){for(var n,r=!1;n=e.next();){if(r&&"/"==n){t.tokenize=null;break}r="*"==n}return"comment"}function d(e,t){for(var n,r=!1;null!=(n=e.next());){if('"'==n&&!r){t.tokenize=null,t.sol=!1;break}r=!r&&"\\"==n}return"string"}function m(e,t){for(e.eatWhile(s);e.eat(s)||e.eat(c););var n=e.current();return!t.sol||"package"!=n&&"model"!=n&&"when"!=n&&"connector"!=n?t.sol&&"end"==n&&0<t.level&&t.level--:t.level++,t.tokenize=null,t.sol=!1,o.propertyIsEnumerable(n)?"keyword":i.propertyIsEnumerable(n)?"builtin":l.propertyIsEnumerable(n)?"atom":"variable"}function k(e,t){for(;e.eat(/[^']/););return t.tokenize=null,t.sol=!1,e.eat("'")?"variable":"error"}function b(e,t){return e.eatWhile(s),e.eat(".")&&e.eatWhile(s),(e.eat("e")||e.eat("E"))&&(e.eat("-")||e.eat("+"),e.eatWhile(s)),t.tokenize=null,t.sol=!1,"number"}return{startState:function(){return{tokenize:null,level:0,sol:!0}},token:function(e,t){if(null!=t.tokenize)return t.tokenize(e,t);if(e.sol()&&(t.sol=!0),e.eatSpace())return t.tokenize=null;var n=e.next();if("/"==n&&e.eat("/"))t.tokenize=f;else if("/"==n&&e.eat("*"))t.tokenize=p;else{if(u.test(n+e.peek()))return e.next(),t.tokenize=null,"operator";if(a.test(n))return t.tokenize=null,"operator";if(c.test(n))t.tokenize=m;else if("'"==n&&e.peek()&&"'"!=e.peek())t.tokenize=k;else if('"'==n)t.tokenize=d;else{if(!s.test(n))return t.tokenize=null,"error";t.tokenize=b}}return t.tokenize(e,t)},indent:function(e,t){if(null!=e.tokenize)return h.Pass;var n=e.level;return/(algorithm)/.test(t)&&n--,/(equation)/.test(t)&&n--,/(initial algorithm)/.test(t)&&n--,/(initial equation)/.test(t)&&n--,/(end)/.test(t)&&n--,0<n?r*n:0},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}});!function(e,t){"string"==typeof e&&(e=[e]);var n=[];function r(e){if(e)for(var t in e)e.hasOwnProperty(t)&&n.push(t)}r(t.keywords),r(t.builtin),r(t.atoms),n.length&&(t.helperType=e[0],h.registerHelper("hintWords",e[0],n));for(var o=0;o<e.length;++o)h.defineMIME(e[o],t)}(["text/x-modelica"],{name:"modelica",keywords:e("algorithm and annotation assert block break class connect connector constant constrainedby der discrete each else elseif elsewhen encapsulated end enumeration equation expandable extends external false final flow for function if import impure in initial inner input loop model not operator or outer output package parameter partial protected public pure record redeclare replaceable return stream then true type when while within"),builtin:e("abs acos actualStream asin atan atan2 cardinality ceil cos cosh delay div edge exp floor getInstanceName homotopy inStream integer log log10 mod pre reinit rem semiLinear sign sin sinh spatialDistribution sqrt tan tanh"),atoms:e("Real Boolean Integer String")})});