Got more regex tests passing

This commit is contained in:
Dan Hirsch 2013-05-24 02:50:05 +02:00
parent 0600440b7c
commit de38f7bce8
5 changed files with 54 additions and 18 deletions

View file

@ -61,7 +61,7 @@ void dump_rvm_prog(HRVMProg *prog) {
uint8_t low, high;
low = insn->arg & 0xff;
high = (insn->arg >> 8) & 0xff;
if (high > low)
if (high < low)
printf("NONE\n");
else {
if (low >= 0x32 && low <= 0x7e)
@ -81,3 +81,20 @@ void dump_rvm_prog(HRVMProg *prog) {
}
}
}
void dump_svm_prog(HRVMProg *prog, HRVMTrace *trace) {
char* symref;
for (; trace != NULL; trace = trace->next) {
printf("@%04zd %-10s", trace->input_pos, svm_op_names[trace->opcode]);
switch (trace->opcode) {
case SVM_ACTION:
symref = getsym(prog->actions[trace->arg].action);
// TODO: somehow format the argument to action
printf("%s\n", symref);
free(symref);
break;
default:
printf("\n");
}
}
}