Added flags for defining rules
This commit is contained in:
parent
b93d8979bd
commit
238ab2afa7
6
bpeg.c
6
bpeg.c
@ -1120,6 +1120,12 @@ int main(int argc, char *argv[])
|
||||
visualize_delay = 100000;
|
||||
} else if (streq(argv[i], "--grammar") || streq(argv[i], "-g")) {
|
||||
grammarfile = argv[++i];
|
||||
} else if (streq(argv[i], "--define") || streq(argv[i], "-d")) {
|
||||
char *def = argv[++i];
|
||||
char *eq = strchr(def, '=');
|
||||
check(eq, usage);
|
||||
*eq = '\0';
|
||||
load_def(def, ++eq);
|
||||
} else if (pattern == NULL) {
|
||||
pattern = argv[i];
|
||||
} else if (infile == NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user