diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2021-01-15 12:44:08 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2021-01-15 12:44:08 -0800 |
| commit | 271ddaae66dd0026829d6fdd54e68d64bbc69c78 (patch) | |
| tree | 7d1d21caa5331d30843460431991035f45e548d6 /bp.c | |
| parent | ce1868d707b0f0338a93057d017252c98e50e15d (diff) | |
Moved too-many-patterns check
Diffstat (limited to 'bp.c')
| -rw-r--r-- | bp.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |
