#include "cycript.hpp"
+#ifdef CY_EXECUTE
+#include "JavaScript.hpp"
+#endif
+
#include <cstdio>
#include <sstream>
void Setup(CYOutput &out, CYDriver &driver) {
out.pretty_ = pretty_;
- CYContext context(driver.pool_);
+ CYOptions options;
+ CYContext context(driver.pool_, options);
driver.program_->Replace(context);
}
code = command;
else {
std::ostringstream str;
- CYOutput out(str);
+ CYOptions options;
+ CYOutput out(str, options);
Setup(out, driver);
out << *driver.program_;
code = str.str();
if (debug)
std::cout << code << std::endl;
- code = "with(Cycript.all){" + code + "}";
Run(client, code, fout, expand);
}
} else if (driver.program_ != NULL)
if (client != -1) {
std::string code(start, end-start);
- code = "with(Cycript.all){" + code + "}";
- Run(client, start, end - start, stdout);
+ Run(client, code, stdout);
} else {
std::ostringstream str;
- CYOutput out(str);
+ CYOptions options;
+ CYOutput out(str, options);
Setup(out, driver);
out << *driver.program_;
std::string code(str.str());
if (compile)
std::cout << code;
- else {
- code = "with(Cycript.all){" + code + "}";
+ else
Run(client, code, stdout);
- }
}
}