import{ES6Parser as e,ES6StaticEval as a}from"/static/quotquot/espression.js";function t(e,...a){for(const r of a)switch(r.type.slice(0,3)){case"Lit":case"Thi":break;case"Com":t(e,...r.body);break;case"Arr":t(e,...r.elements);break;case"Una":t(e,r.argument);break;case"Log":case"Bin":t(e,r.left,r.right);break;case"Con":t(e,r.test,r.consequent,r.alternate);break;case"Cal":t(e,r.callee,...r.arguments);break;case"Ide":e.add(r.name);break;case"Mem":switch(r.object.type.slice(0,3)){case"Ide":e.add(r.object.name);break;case"Thi":e.add(r.property.name);break;case"Mem":t(e,r.object);break;default:throw new Error(`Unhandled member expression ${r.object.type}`)}break;default:throw new Error(`unhandled node type ${r.type}`)}}const r=new e,s=new a;var n={parse:r.parse.bind(r),evaluate:s.evaluate.bind(s),variables:function(e){const a=new Set;return t(a,e),a}};export{n as default};
