Skip to content

Commit

Permalink
Add "Bidi" and "In" support to unicode character properties.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmichaud committed Apr 9, 2009
1 parent a2bb078 commit f545fee
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/ops/perl6.ops
Expand Up @@ -147,6 +147,28 @@ inline op is_uprop(out INT, in STR, in STR, in INT) :base_core {
ord = string_ord(interp, $3, $4);
cstr = Parrot_str_to_cstring(interp, $2);

/* try block tests */
if (strncmp(cstr, "In", 2) == 0) {
strwhich = u_getPropertyValueEnum(UCHAR_BLOCK, cstr+2);
ordwhich = u_getIntPropertyValue(ord, UCHAR_BLOCK);
if (strwhich != UCHAR_INVALID_CODE) {
$1 = (strwhich == ordwhich);
Parrot_str_free_cstring(cstr);
goto NEXT();
}
}

/* try bidi tests */
if (strncmp(cstr, "Bidi", 2) == 0) {
strwhich = u_getPropertyValueEnum(UCHAR_BIDI_CLASS, cstr+4);
ordwhich = u_getIntPropertyValue(ord, UCHAR_BIDI_CLASS);
if (strwhich != UCHAR_INVALID_CODE) {
$1 = (strwhich == ordwhich);
Parrot_str_free_cstring(cstr);
goto NEXT();
}
}

/* try property value aliases */
strwhich = u_getPropertyValueEnum(UCHAR_GENERAL_CATEGORY_MASK, cstr);
if (strwhich != UCHAR_INVALID_CODE) {
Expand Down

0 comments on commit f545fee

Please sign in to comment.