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