(function(t){typeof exports=="object"&&typeof module=="object"?t(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)})(function(t){"use strict";t.defineMode("yacas",function(f,g){function a(e){for(var n={},r=e.split(" "),o=0;o<r.length;++o)n[r[o]]=!0;return n}var p=a("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"),d="(?:(?:\\.\\d+|\\d+\\.\\d*|\\d+)(?:[eE][+-]?\\d+)?)",u="(?:[a-zA-Z\\$'][a-zA-Z0-9\\$']*)",s=new RegExp(d),k=new RegExp(u),b=new RegExp(u+"?_"+u),h=new RegExp(u+"\\s*\\(");function c(e,n){var r;if(r=e.next(),r==='"')return n.tokenize=v,n.tokenize(e,n);if(r==="/"){if(e.eat("*"))return n.tokenize=m,n.tokenize(e,n);if(e.eat("/"))return e.skipToEnd(),"comment"}e.backUp(1);var o=e.match(/^(\w+)\s*\(/,!1);o!==null&&p.hasOwnProperty(o[1])&&n.scopes.push("bodied");var i=l(n);if(i==="bodied"&&r==="["&&n.scopes.pop(),(r==="["||r==="{"||r==="(")&&n.scopes.push(r),i=l(n),(i==="["&&r==="]"||i==="{"&&r==="}"||i==="("&&r===")")&&n.scopes.pop(),r===";")for(;i==="bodied";)n.scopes.pop(),i=l(n);return e.match(/\d+ *#/,!0,!1)?"qualifier":e.match(s,!0,!1)?"number":e.match(b,!0,!1)?"variable-3":e.match(/(?:\[|\]|{|}|\(|\))/,!0,!1)?"bracket":e.match(h,!0,!1)?(e.backUp(1),"variable"):e.match(k,!0,!1)?"variable-2":e.match(/(?:\\|\+|\-|\*|\/|,|;|\.|:|@|~|=|>|<|&|\||_|`|'|\^|\?|!|%|#)/,!0,!1)?"operator":"error"}function v(e,n){for(var r,o=!1,i=!1;(r=e.next())!=null;){if(r==='"'&&!i){o=!0;break}i=!i&&r==="\\"}return o&&!i&&(n.tokenize=c),"string"}function m(e,n){for(var r,o;(o=e.next())!=null;){if(r==="*"&&o==="/"){n.tokenize=c;break}r=o}return"comment"}function l(e){var n=null;return e.scopes.length>0&&(n=e.scopes[e.scopes.length-1]),n}return{startState:function(){return{tokenize:c,scopes:[]}},token:function(e,n){return e.eatSpace()?null:n.tokenize(e,n)},indent:function(e,n){if(e.tokenize!==c&&e.tokenize!==null)return t.Pass;var r=0;return(n==="]"||n==="];"||n==="}"||n==="};"||n===");")&&(r=-1),(e.scopes.length+r)*f.indentUnit},electricChars:"{}[]();",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}}),t.defineMIME("text/x-yacas",{name:"yacas"})});
