updated limits

This commit is contained in:
~d6 2024-05-05 20:24:50 -04:00
parent e073d7c884
commit 8338a5c59d
1 changed files with 11 additions and 6 deletions

View File

@ -1,15 +1,19 @@
#include <stdio.h>
#define RULES 0x2000
#define DICT 0x10000
#define BANK 0x8000
typedef struct {
unsigned int id, refs;
char *a, *b;
} Rule;
static int flip, quiet, debug, cycles = 0x10000;
static Rule rules[0x1000], *rules_ = rules, lambda;
static char dict[0x8000], *dict_ = dict, empty;
static char bank_a[0x4000], *src_ = bank_a;
static char bank_b[0x4000], *dst_ = bank_b;
static int flip, quiet, unused, debug, cycles = 0x10000;
static Rule rules[RULES], *rules_ = rules, lambda;
static char dict[DICT], *dict_ = dict, empty;
static char bank_a[BANK], *src_ = bank_a;
static char bank_b[BANK], *dst_ = bank_b;
static char *regs[0x100], stack[0x10], *stack_ = stack;
#define spacer(c) (c <= ' ' || c == '(' || c == ')')
@ -290,6 +294,7 @@ main(int argc, char **argv)
case 'q': /* quiet */ quiet = 1; break;
case 'p': /* debug */ debug = 1; break;
case 'n': /* infinite */ cycles = 0xffffffff; break;
case 'u': /* unused */ unused = 1; break;
}
}
if(!(f = fopen(argv[i], "r")))
@ -314,7 +319,7 @@ main(int argc, char **argv)
if(!quiet) {
while(rules_-- > rules) {
if(rules_->a) {
if(!rules_->refs)
if(unused && !rules_->refs)
fprintf(stderr, "-- Unused rule: %d <> (%s) (%s)\n", rules_->id, rules_->a, rules_->b);
if(debug)
fprintf(stderr, " (%s) (%s), %d times.\n", rules_->a, rules_->b, rules_->refs);