static bool bison_;
#endif
static bool strict_;
+static bool pretty_;
void Setup(CYDriver &driver, cy::parser &parser) {
#if YYDEBUG
driver.strict_ = true;
}
+void Setup(CYOutput &out) {
+ out.pretty_ = pretty_;
+}
+
void Run(int socket, const char *data, size_t size, FILE *fout = NULL, bool expand = false) {
CYPool pool;
else {
std::ostringstream str;
CYOutput out(str);
+ Setup(out);
driver.program_->Multiple(out);
code = str.str();
}
pid_t pid(_not(pid_t));
bool compile(false);
- for (;;) switch (getopt(argc, argv, "cg:p:s")) {
+ for (;;) switch (getopt(argc, argv, "cg:n:p:s")) {
case -1:
goto getopt;
case '?':
}
break;
+ case 'n':
+ if (false);
+ else if (strcmp(optarg, "minify") == 0)
+ pretty_ = true;
+ else {
+ fprintf(stderr, "invalid name for -n\n");
+ return 1;
+ }
+ break;
+
case 'p': {
size_t size(strlen(optarg));
char *end;
else {
std::ostringstream str;
CYOutput out(str);
+ Setup(out);
driver.program_->Multiple(out);
std::string code(str.str());
if (compile)