This commit is contained in:
Stephen Dolan committed 2013-05-05 22:59:53 +01:00
1 parent a49402c53a
commit c1748fa633
2 files changed
+9 -6

No files matched your search

-2
View File
@@ -53,11 +53,9 @@ static void run_jq_tests() {
tests++;
struct bytecode* bc = jq_compile(buf);
if (!bc) {invalid++; continue;}
#if JQ_DEBUG
printf("Disassembly:\n");
dump_disassembly(2, bc);
printf("\n");
#endif
fgets(buf, sizeof(buf), testdata);
jv input = jv_parse(buf);
if (!jv_is_valid(input)){ invalid++; continue; }
+9 -4
View File
@@ -57,6 +57,9 @@ enum {
NO_COLOUR_OUTPUT = 128,
FROM_FILE = 256,
/* debugging only */
DUMP_DISASM = 2048,
};
static int options = 0;
static struct bytecode* bc;
@@ -180,6 +183,8 @@ int main(int argc, char* argv[]) {
options |= PROVIDE_NULL;
} else if (isoption(argv[i], 'f', "from-file")) {
options |= FROM_FILE;
} else if (isoption(argv[i], 0, "debug-dump-disasm")) {
options |= DUMP_DISASM;
} else if (isoption(argv[i], 'h', "help")) {
usage();
} else if (isoption(argv[i], 'V', "version")) {
@@ -213,10 +218,10 @@ int main(int argc, char* argv[]) {
}
if (!bc) return 1;
#if JQ_DEBUG
dump_disassembly(0, bc);
printf("\n");
#endif
if (options & DUMP_DISASM) {
dump_disassembly(0, bc);
printf("\n");
}
if (options & PROVIDE_NULL) {
process(jv_null());