summaryrefslogtreecommitdiff
path: root/src/sam_edit.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-05 00:03:55 -0300
committerGabriel Schneider <[email protected]>2026-11-05 01:16:28 -0300
commita92951b11ab3aa2cdf759b3b743f8af006c21b95 (patch)
treeb63d45772ea2053f0feb796e5893b81f88a1bf0c /src/sam_edit.zig
parentbbb4362a46de8e8d10a6a937e61ccc8f3a0ba4b3 (diff)
downloadpardes-a92951b11ab3aa2cdf759b3b743f8af006c21b95.tar.gz
pardes-a92951b11ab3aa2cdf759b3b743f8af006c21b95.zip
regexp, sam_edit, ninep/addr: a pattern's compile error is told by Regex.message(err), which replaces the five e_ constants and the two switches that mapped errors onto them
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/sam_edit.zig')
-rw-r--r--src/sam_edit.zig6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/sam_edit.zig b/src/sam_edit.zig
index b06379f9..a6ed5772 100644
--- a/src/sam_edit.zig
+++ b/src/sam_edit.zig
@@ -611,15 +611,11 @@ const Exec = struct {
fn compile(ex: *Exec, pat: []const u8, c: u8) Failure!regexp.Regex {
return regexp.Regex.compile(pat) catch |err| switch (err) {
- error.Anchor => fail(ex.why, "{s}", .{regexp.Regex.e_anchor}),
- error.TooLong => fail(ex.why, "{s}", .{regexp.Regex.e_long}),
- error.WideRange => fail(ex.why, "{s}", .{regexp.Regex.e_wide}),
- error.NegatedRunes => fail(ex.why, "{s}", .{regexp.Regex.e_negated}),
- error.Mixed => fail(ex.why, "{s}", .{regexp.Regex.e_mixed}),
error.Bad => if (c == '"' or c == 'X' or c == 'Y')
fail(ex.why, "bad regexp in file match", .{})
else
fail(ex.why, "bad regexp in {c} command", .{c}),
+ else => fail(ex.why, "{s}", .{regexp.Regex.message(err)}),
};
}