diff --git a/src/modal.c b/src/modal.c index 8d99423..aafb989 100644 --- a/src/modal.c +++ b/src/modal.c @@ -148,6 +148,7 @@ apply_rule(Rule *r, char *s) while(*s == ' ') s++; if(*s == ')' && *(dst_ - 1) == ' ') dst_--; } + printf("[%s]\n", r->a); return write_rule(r, s, 0); } @@ -216,7 +217,7 @@ rewrite(void) if(c == '?' && s[1] == '(') { cap = walk(s + 1), compile_rule(&lambda, -1, s + 2), s = cap; while(*s == ' ') s++; - if(!apply_rule(&lambda, s)) write_rule(r, s, 0); + if(!apply_rule(&lambda, s)) write_rule(&lambda, s, 0); return 1; } /* phase: match */ @@ -240,7 +241,7 @@ main(int argc, char **argv) return !printf("usage: modal [-vqn] source.modal\n"); for(i = 1; i < argc && *argv[i] == '-'; i++) { switch(argv[i][1]) { - case 'v': /* version */ return !printf("Modal Interpreter, 25 Apr 2024.\n"); + case 'v': /* version */ return !printf("Modal Interpreter, 26 Apr 2024.\n"); case 'q': /* quiet */ quiet = 1; break; case 'n': /* infinite */ cycles = 0xffffffff; break; }