summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-22 19:01:54 -0300
committerGabriel Schneider <[email protected]>2026-11-22 19:01:54 -0300
commit79b73e14711e48e61d0f742622671a8fcfd8d054 (patch)
tree16c4e9815c090008f03752739b6d4590d26caa01 /build
parentb3c38ea198e1fe915f029d7e41b469b8a53d2338 (diff)
parent19386feb0074afc1afed6e8ebe8596c426e4bdb0 (diff)
downloadpardes-79b73e14711e48e61d0f742622671a8fcfd8d054.tar.gz
pardes-79b73e14711e48e61d0f742622671a8fcfd8d054.zip
integration: the pair's chain and the regular expressions' three panics on the gathered line: pardes-pair-11 (`kpskrqqt`: pardes-merge57 with the pair's ten changes merged past the four already there, its conflicts resolved by the agent that gated it: a window client's Font, an addon's landing on the tape and a near client loading it by path when its bytes are the session's, a window's facts its client's, the terminal put back when a pair's client dies without a word, a Restore telling its clients, daemon.py's --with-pair and the Restore test) and pardes-regex-3 (`szlonulo` on `qzrzlnox`, on pardes-merge57: mvzr panicked on an empty group with more after it, a repeat right after | or ^, a count ending in neither , nor }: three Edits in build/patches.zig, docs/mvzr-empty-group.md, the test of every short pattern); no conflict; core-test 917/1074 (157 skipped), shell-test 1116/1119; its gate: .scratch/sketch/reorg/merge58, the numbers in PARDES.md (2026-11-22)
Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'build')
-rw-r--r--build/patches.zig15
1 files changed, 15 insertions, 0 deletions
diff --git a/build/patches.zig b/build/patches.zig
index 7d87b9f1..410d27ab 100644
--- a/build/patches.zig
+++ b/build/patches.zig
@@ -356,6 +356,15 @@ pub fn ghosttyKitty(b: *std.Build, patch: *std.Build.Step.Compile, dep: *std.Bui
/// could compile one typed pattern differently. Unreported upstream as
/// of 3efcfe33 (its trunk on 2026-11-19); docs/mvzr-bounds.md is the
/// report for it.
+/// - Three kinds of pattern the matcher indexed an empty slice on (a panic
+/// in a safe build, at a key typed into `s` or `/`): an empty group with
+/// more after it (`()a`, `a()b`: whether the group may match nothing was
+/// asked of its inside's first operation, which it has not got); a
+/// repeat right after `|` or `^` (`a|*`, `|??`, `^*`: it took the `|` or
+/// the `^` for what it repeats; at the pattern's start it was already
+/// refused); and a count that ends in neither `,` nor `}` (`({1))`: the
+/// character after it was skipped and a hole left in the program, which
+/// ends it there). docs/mvzr-empty-group.md is the report for upstream.
const mvzr_edits = [_]Edit{
.{
.old = "fn matchPattern(patt: []const RegOp, sets: []const CharSet, haystack: []const u8, i_in: usize) ?OpMatch {\n",
@@ -419,6 +428,12 @@ const mvzr_edits = [_]Edit{
.{ .old = "fn valueFor(in: []const u8) ?u8 {\n", .new = "fn valueFor(in: []const u8) ?u8 {\n if (in.len == 0) return null;\n" },
.{ .old = " return parseHex(in[1..4]) catch return null;\n", .new = " return parseHex(in[1..3]) catch return null;\n" },
.{ .old = " if (i == in.len or in[i] != ']') {\n return BadString;\n", .new = " if (i >= in.len or in[i] != ']') {\n return BadString;\n" },
+ // What compiles is a program the matcher can walk: an empty pattern
+ // accepts the empty string; a repeat repeats an operation; a count is
+ // closed.
+ .{ .old = "fn patternAcceptsEmpty(patt: []const RegOp) bool {\n", .new = "fn patternAcceptsEmpty(patt: []const RegOp) bool {\n if (patt.len == 0) return true;\n" },
+ .{ .old = " if (j == 0 or patt[j] == .begin) return BadString;\n", .new = " if (j == 0 or patt[j - 1] == .begin or patt[j - 1] == .alt) return BadString;\n" },
+ .{ .old = " } else if (in[i] == '}') {\n // {M}\n", .new = " } else if (in[i] != '}') {\n bad_string = true;\n break :dispatch;\n } else {\n // {M}\n" },
.{ .old = "for (c1..c2 + 1) |c_range|", .new = "for (c1..@as(usize, c2) + 1) |c_range|" },
.{ .old = "[1]RegOp{.{ .unused = {} }} ** ops", .new = "@splat(.{ .unused = {} })" },
.{ .old = "[1]CharSet{.{ .low = 0, .hi = 0 }} ** char_sets", .new = "@splat(.{ .low = 0, .hi = 0 })" },