function u(e){for(var t={},r=e.split(" "),o=0;o<r.length;++o)t[r[o]]=!0;return t}var l=u("Assert BackQuote D Defun Deriv For ForEach FromFile FromString Function Integrate InverseTaylor Limit LocalSymbols Macro MacroRule MacroRulePattern NIntegrate Rule RulePattern Subst TD TExplicitSum TSum Taylor Taylor1 Taylor2 Taylor3 ToFile ToStdout ToString TraceRule Until While"),s="(?:(?:\\.\\d+|\\d+\\.\\d*|\\d+)(?:[eE][+-]?\\d+)?)",a="(?:[a-zA-Z\\$'][a-zA-Z0-9\\$']*)",p=new RegExp(s),f=new RegExp(a),m=RegExp(a+"?_"+a),k=RegExp(a+"\\s*\\(");function i(e,t){var r=e.next();if(r==='"')return t.tokenize=h,t.tokenize(e,t);if(r==="/"){if(e.eat("*"))return t.tokenize=d,t.tokenize(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}e.backUp(1);var o=e.match(/^(\w+)\s*\(/,!1);o!==null&&l.hasOwnProperty(o[1])&&t.scopes.push("bodied");var n=c(t);if(n==="bodied"&&r==="["&&t.scopes.pop(),(r==="["||r==="{"||r==="(")&&t.scopes.push(r),n=c(t),(n==="["&&r==="]"||n==="{"&&r==="}"||n==="("&&r===")")&&t.scopes.pop(),r===";")for(;n==="bodied";)t.scopes.pop(),n=c(t);return e.match(/\d+ *#/,!0,!1)?"qualifier":e.match(p,!0,!1)?"number":e.match(m,!0,!1)?"variableName.special":e.match(/(?:\[|\]|{|}|\(|\))/,!0,!1)?"bracket":e.match(k,!0,!1)?(e.backUp(1),"variableName.function"):e.match(f,!0,!1)?"variable":e.match(/(?:\\|\+|\-|\*|\/|,|;|\.|:|@|~|=|>|<|&|\||_|`|'|\^|\?|!|%|#)/,!0,!1)?"operator":"error"}function h(e,t){for(var r,o=!1,n=!1;(r=e.next())!=null;){if(r==='"'&&!n){o=!0;break}n=!n&&r==="\\"}return o&&!n&&(t.tokenize=i),"string"}function d(e,t){for(var r,o;(o=e.next())!=null;){if(r==="*"&&o==="/"){t.tokenize=i;break}r=o}return"comment"}function c(e){var t=null;return e.scopes.length>0&&(t=e.scopes[e.scopes.length-1]),t}const b={name:"yacas",startState:function(){return{tokenize:i,scopes:[]}},token:function(e,t){return e.eatSpace()?null:t.tokenize(e,t)},indent:function(e,t,r){if(e.tokenize!==i&&e.tokenize!==null)return null;var o=0;return(t==="]"||t==="];"||t==="}"||t==="};"||t===");")&&(o=-1),(e.scopes.length+o)*r.unit},languageData:{electricInput:/[{}\[\]()\;]/,commentTokens:{line:"//",block:{open:"/*",close:"*/"}}}};export{b as t};
