Fix heapsort in capture list construction (#748)

This commit is contained in:
Zoltan Herczeg
2025-05-12 18:43:08 +02:00
committed by GitHub
parent c987eb81e3
commit bcc12d9056
3 changed files with 25 additions and 0 deletions

View File

@@ -479,6 +479,7 @@ while (TRUE)
tmp = captures[i];
captures[i] = captures[max];
captures[max] = tmp;
i = max;
}
}

3
testdata/testinput2 vendored
View File

@@ -7961,6 +7961,9 @@ a)"xI
\= Expect no match
Saturday,Sun
/()()()(?2(2,3,2,3,2))/B
abc
# Test each syntax used for recursion
/(?(R)(Sat)urday|(?R(1)),\1)/

21
testdata/testoutput2 vendored
View File

@@ -22408,6 +22408,27 @@ No match
Saturday,Sun
No match
/()()()(?2(2,3,2,3,2))/B
------------------------------------------------------------------
Bra
CBra 1
Ket
CBra 2
Ket
CBra 3
Ket
Recurse
2 Capture ref
3 Capture ref
Ket
End
------------------------------------------------------------------
abc
0:
1:
2:
3:
# Test each syntax used for recursion
/(?(R)(Sat)urday|(?R(1)),\1)/