function l(n){for(var e={},t=n.split(" "),o=0;o<t.length;++o)e[t[o]]=!0;return e}var a=l("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"),i=l("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"),u=l("Real Boolean Integer String"),c=[].concat(Object.keys(a),Object.keys(i),Object.keys(u)),p=/[;=\(:\),{}.*<>+\-\/^\[\]]/,k=/(:=|<=|>=|==|<>|\.\+|\.\-|\.\*|\.\/|\.\^)/,r=/[0-9]/,s=/[_a-zA-Z]/;function f(n,e){return n.skipToEnd(),e.tokenize=null,"comment"}function m(n,e){for(var t=!1,o;o=n.next();){if(t&&o=="/"){e.tokenize=null;break}t=o=="*"}return"comment"}function d(n,e){for(var t=!1,o;(o=n.next())!=null;){if(o=='"'&&!t){e.tokenize=null,e.sol=!1;break}t=!t&&o=="\\"}return"string"}function z(n,e){for(n.eatWhile(r);n.eat(r)||n.eat(s););var t=n.current();return e.sol&&(t=="package"||t=="model"||t=="when"||t=="connector")?e.level++:e.sol&&t=="end"&&e.level>0&&e.level--,e.tokenize=null,e.sol=!1,a.propertyIsEnumerable(t)?"keyword":i.propertyIsEnumerable(t)?"builtin":u.propertyIsEnumerable(t)?"atom":"variable"}function b(n,e){for(;n.eat(/[^']/););return e.tokenize=null,e.sol=!1,n.eat("'")?"variable":"error"}function h(n,e){return n.eatWhile(r),n.eat(".")&&n.eatWhile(r),(n.eat("e")||n.eat("E"))&&(n.eat("-")||n.eat("+"),n.eatWhile(r)),e.tokenize=null,e.sol=!1,"number"}const g={name:"modelica",startState:function(){return{tokenize:null,level:0,sol:!0}},token:function(n,e){if(e.tokenize!=null)return e.tokenize(n,e);if(n.sol()&&(e.sol=!0),n.eatSpace())return e.tokenize=null,null;var t=n.next();if(t=="/"&&n.eat("/"))e.tokenize=f;else if(t=="/"&&n.eat("*"))e.tokenize=m;else{if(k.test(t+n.peek()))return n.next(),e.tokenize=null,"operator";if(p.test(t))return e.tokenize=null,"operator";if(s.test(t))e.tokenize=z;else if(t=="'"&&n.peek()&&n.peek()!="'")e.tokenize=b;else if(t=='"')e.tokenize=d;else if(r.test(t))e.tokenize=h;else return e.tokenize=null,"error"}return e.tokenize(n,e)},indent:function(n,e,t){if(n.tokenize!=null)return null;var o=n.level;return/(algorithm)/.test(e)&&o--,/(equation)/.test(e)&&o--,/(initial algorithm)/.test(e)&&o--,/(initial equation)/.test(e)&&o--,/(end)/.test(e)&&o--,o>0?t.unit*o:0},languageData:{commentTokens:{line:"//",block:{open:"/*",close:"*/"}},autocomplete:c}};export{g as t};
