Skip to content

Commit

Permalink
pcre2: fix un-named capture groups
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjbq7 committed May 5, 2024
1 parent 160559f commit 4decce4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 10 additions & 0 deletions extra/pcre2/pcre2-tests.factor
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,13 @@ USING: pcre2 sequences tools.test ;
"1999-01-12" "(?P<year>\\d{4})-(?P<month>\\d{2})-(?P<day>\\d{2})"
findall first
] unit-test

{
{
{ { f "h" } }
{ { f "e" } }
{ { f "l" } }
{ { f "l" } }
{ { f "o" } }
}
} [ "hello" "(.)" findall ] unit-test
2 changes: 0 additions & 2 deletions extra/pcre2/pcre2.factor
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ M:: pcre2 findall ( subject obj -- matches )
[ throw ]
} case
] [
rc name_count 1 + assert=
match_data pcre2_get_ovector_pointer
rc assert-positive 2 * PCRE2_SIZE <c-direct-array> :> ovector

Expand Down Expand Up @@ -212,7 +211,6 @@ M:: pcre2 findall ( subject obj -- matches )

f
] [
rc name_count 1 + assert=
[
f ovector first2 subject subseq 2array ,
name_table [
Expand Down

0 comments on commit 4decce4

Please sign in to comment.