Fixing bug in regexp \P

release
Daniel Ehrenberg 2010-03-23 00:30:49 -04:00
parent 1d5e5d00f1
commit 88e88207ff
2 changed files with 6 additions and 1 deletions

View File

@ -133,7 +133,7 @@ CharacterInBracket = !("}") Character
QuotedCharacter = !("\\E") .
Escape = "p{" CharacterInBracket*:s "}" => [[ s name>class <primitive-class> ]]
| "P{" CharacterInBracket*:s "}" => [[ s name>class <primitive-class> <negation> ]]
| "P{" CharacterInBracket*:s "}" => [[ s name>class <primitive-class> <not-class> ]]
| "Q" QuotedCharacter*:s "\\E" => [[ s <concatenation> ]]
| "u" Character:a Character:b Character:c Character:d
=> [[ { a b c d } hex> ensure-number ]]

View File

@ -530,3 +530,8 @@ IN: regexp-tests
[ f ] [ "π" R/ [\p{script=latin}--\p{lower}]/ matches? ] unit-test
[ t ] [ "A" R/ [\p{script=latin}--\p{lower}]/ matches? ] unit-test
[ f ] [ "3" R/ [\p{script=latin}--\p{lower}]/ matches? ] unit-test
[ t ] [ " " R/ \P{alpha}/ matches? ] unit-test
[ f ] [ "" R/ \P{alpha}/ matches? ] unit-test
[ f ] [ "a " R/ \P{alpha}/ matches? ] unit-test
[ f ] [ "a" R/ \P{alpha}/ matches? ] unit-test