X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Moose.xs;h=caf560d8291245ae64aecc42dc596c1d3b94e067;hb=9d2b905f23cfad200e37384e93dcd4dc87dc2f97;hp=38130aa36f76628822d3a79423fb47790df1c12f;hpb=7ce1a351679e88e9efa698468d6dae47f8afcbfe;p=gitmo%2FMoose.git diff --git a/Moose.xs b/Moose.xs index 38130aa..caf560d 100644 --- a/Moose.xs +++ b/Moose.xs @@ -16,24 +16,6 @@ #endif /* FIXME - * type constraints are already implemented by konobi - * should be trivial to do coercions for the core types, too - * - * TypeConstraint::Class can compare SvSTASH by ptr, and if it's neq *then* - * call ->isa (should handle vast majority of cases) - * - * base parametrized types are also trivial - * - * ClassName is get_stathpvn - */ - -/* FIXME - * for a constructor we have ATTR *attrs, and iterate that, removing init_arg - * we can preallocate the structure to the right size (maybe even with the - * right HEs?), and do various other prehashing hacks to gain speed - * */ - -/* FIXME * delegations and attribute helpers: * * typedef struct { @@ -345,14 +327,23 @@ STATIC bool check_sv_type (TC type, SV *sv) { if ( SvIOK(sv) ) { return 1; } else if ( SvPOK(sv) ) { + /* FIXME i really don't like this */ int i; STRLEN len; char *pv = SvPV(sv, len); char *end = pv + len; + char *tail = end; errno = 0; - i = strtol(pv, &end, 0); - return !errno; + i = strtol(pv, &tail, 0); + + if ( errno ) return 0; + + while ( tail != end ) { + if ( !isspace(*tail++) ) return 0; + } + + return 1; } return 0; break;