Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Commit] Character classification functions

2 views
Skip to first unread message

Peter Gibbs

unread,
Nov 4, 2003, 11:33:42 AM11/4/03
to perl6-internals
The infrastructure is now in place to test for character classes other
than is_digit. Character class functions may be specific to one class,
or generic; this split is controlled by the sequence of the enums in
chartype.h

Currently only is_digit has a dedicated function call slot, as this is
the only one that is actually implemented for all chartypes. The generic
function for usascii handles the standard glibc set (alnum,alpha,etc.);
unicode awaits the interface to ICU.

Calls to the charclass functions are done via macros of the form
Parrot_char_is_digit(chartype, value). These macros are generated to
point to either a dedicated slot or the generic function, as
appropriate. Note that this generation was achieved by changing
config/gen/parrot_include.pl to allow execution of perl code during the
parsing of header files - somebody who knows this stuff better than I do
may want to check to see if I've broken anything too badly.

Regards
Peter Gibbs
EmKel Systems

0 new messages