aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-11-13 19:49:18 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-11-13 19:49:18 +0100
commitffcb9954a9ab4c0ddbc9458be67f9c40ab13ae7a (patch)
tree7bd4bec08c994a9a317059ef7aa3e1244a5e41fa
parenta811ec6990daf3628f48feeae2746cba3dfa428a (diff)
Print the regex that failed to compile
-rw-r--r--src/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 40c9de4..1679da1 100644
--- a/src/main.c
+++ b/src/main.c
@@ -367,7 +367,8 @@ pattern_comp(u8view_t pat)
if (op.re == nullptr) {
/* TODO: Print which regex failed to compile */
pcre2_bitch_and_die(
- ec, "failed to compile regex at byte offset %zu", eoff);
+ ec, "failed to compile regex %s%.*s%s at byte offset %zu",
+ lquot, SV_PRI_ARGS(re), rquot, eoff);
}
if ((ec = pcre2_jit_compile(op.re, PCRE2_JIT_COMPLETE)) != 0)
pcre2_bitch_and_die(ec, "failed to JIT compile regex");