"use strict";var e=require("./postfix_evaluator.js");e.prototype.formulaEval=function(){for(var e,p,t,u=[],l=this.value,s=0;s<l.length;s++)1===l[s].type||3===l[s].type?u.push({value:3===l[s].type?l[s].show:l[s].value,type:1}):13===l[s].type?u.push({value:l[s].show,type:1}):0===l[s].type?u[u.length-1]={value:l[s].show+("-"!=l[s].show?"(":"")+u[u.length-1].value+("-"!=l[s].show?")":""),type:0}:7===l[s].type?u[u.length-1]={value:(1!=u[u.length-1].type?"(":"")+u[u.length-1].value+(1!=u[u.length-1].type?")":"")+l[s].show,type:7}:10===l[s].type?(e=u.pop(),p=u.pop(),"P"===l[s].show||"C"===l[s].show?u.push({value:"<sup>"+p.value+"</sup>"+l[s].show+"<sub>"+e.value+"</sub>",type:10}):u.push({value:(1!=p.type?"(":"")+p.value+(1!=p.type?")":"")+"<sup>"+e.value+"</sup>",type:1})):2===l[s].type||9===l[s].type?(e=u.pop(),p=u.pop(),u.push({value:(1!=p.type?"(":"")+p.value+(1!=p.type?")":"")+l[s].show+(1!=e.type?"(":"")+e.value+(1!=e.type?")":""),type:l[s].type})):12===l[s].type&&(e=u.pop(),p=u.pop(),t=u.pop(),u.push({value:l[s].show+"("+t.value+","+p.value+","+e.value+")",type:12}));return u[0].value},module.exports=e;
