aboutsummaryrefslogtreecommitdiff
path: root/bp.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2021-01-15 12:44:08 -0800
committerBruce Hill <bruce@bruce-hill.com>2021-01-15 12:44:08 -0800
commit271ddaae66dd0026829d6fdd54e68d64bbc69c78 (patch)
tree7d1d21caa5331d30843460431991035f45e548d6 /bp.c
parentce1868d707b0f0338a93057d017252c98e50e15d (diff)
Moved too-many-patterns check
Diffstat (limited to 'bp.c')
-rw-r--r--bp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bp.c b/bp.c
index 0b0590f..c221683 100644
--- a/bp.c
+++ b/bp.c
@@ -310,7 +310,6 @@ int main(int argc, char *argv[])
check(f != NULL, "Couldn't find grammar: %s", flag);
defs = load_grammar(defs, f); // Keep in memory for debug output
} else if (FLAG("--pattern") || FLAG("-p")) {
- check(npatterns == 0, "Cannot define multiple patterns");
file_t *arg_file = spoof_file(&loaded_files, "<pattern argument>", flag);
for (const char *str = arg_file->contents; str < arg_file->end; ) {
def_t *d = bp_definition(arg_file, str);
@@ -319,6 +318,7 @@ int main(int argc, char *argv[])
defs = d;
str = d->op->end;
} else {
+ check(npatterns == 0, "Cannot define multiple patterns");
vm_op_t *p = bp_pattern(arg_file, str);
check(p, "Pattern failed to compile: %s", flag);
defs = with_def(defs, arg_file, strlen("pattern"), "pattern", p);