summaryrefslogtreecommitdiff
path: root/universal.c
Commit message (Collapse)AuthorAgeFilesLines
* initialize undefined version objects with zero, not 'undef'David Golden2010-01-211-2/+2
|
* Omnibus strict and lax version parsingDavid Golden2010-01-131-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Authors: John Peacock, David Golden and Zefram The goal of this mega-patch is to enforce strict rules for version numbers provided to 'package NAME VERSION' while formalizing the prior, lax rules used for version object creation. Parsing for use() is unchanged. version.pm adds two globals, $STRICT and $LAX, containing regular expressions that define the rules. There are two additional functions -- version::is_strict and version::is_lax -- that test an argument against these rules. However, parsing of strings that might contain version numbers is done in core via the Perl_scan_version function, which may be called during compilation or may be called later when version objects are created by Perl_new_version or Perl_upg_version. A new helper function, Perl_prescan_version, has been added to validate a string under either strict or lax rules. This is used in toke.c for 'package NAME VERSION' in strict mode and by Perl_scan_version in lax mode. It matches the behavior of the verison.pm regular expressions, but does not use them directly. A new test file, comp/packagev.t, validates strict and lax behaviors of 'package NAME VERSION' and 'version->new(VERSION)' respectively and verifies their behavior against the $STRICT and $LAX regular expressions, as well. Validating these two implementation should help ensure they each work as intended. Other files and tests have been modified as necessary to support these changes. There is remaining work to be done in a few areas: * documenting all changes in behavior and new functions * determining proper treatment of "," as decimal separators in various locales * updating diagnostics for new error messages * porting changes back to the version.pm distribution on CPAN, including pure-Perl versions
* Tie::Hash::NamedCapture::* shouldn't abort if passed bad input [RT #71828]Nicholas Clark2010-01-051-8/+8
|
* Add missing LEAVE to universal.c sv_doesGerard Goossen2009-11-121-2/+6
|
* Unused 'cv'Jerry D. Hedden2009-07-021-0/+1
|
* Integrate version.pm-0.77 into bleadperlJohn Peacock2009-06-281-9/+41
|
* Note why we need a seemingly useless empty &Regexp::DESTROYNicholas Clark2009-03-311-0/+1
|
* Change Regexp::DESTROY to be a constant subroutine, removing XS_Regexp_DESTROY.Nicholas Clark2009-03-291-8/+2
| | | | A constant subroutine is now optimised away at DESTROY time.
* Remove declaration of XS_Internals_inc_sub_generationRafael Garcia-Suarez2009-03-081-1/+0
| | | | | The function Internals::inc_sub_generation() was removed in commit 41892db1963e88b547da12808d8e5630cc1edb59
* Make PerlIO::get_layers really test flgok before reading *flgsvpVincent Pit2009-03-071-1/+1
|
* get_isa_hash() is only used in S_isa_lookup(), so it can be static. Also, it hasNicholas Clark2009-01-031-3/+3
| | | | | never been in a released version of perl, so this change has no compatibility implications.
* Following change 34356, which decoupled get_isa_hash() fromNicholas Clark2009-01-031-0/+35
| | | | S_mro_get_linear_isa_dfs(), we can move get_isa_hash() to any other source file.
* PATCH: Large omnibus patch to clean up the JRRT quotesTom Christiansen2008-11-021-3/+5
| | | | | | Message-ID: <25940.1225611819@chthon> Date: Sun, 02 Nov 2008 01:43:39 -0600 p4raw-id: //depot/perl@34698
* Explicitly specify some printf formats for constant strings.Rafael Garcia-Suarez2008-11-021-3/+3
| | | | | | This is mostly to silence gcc's warning, "format not a string literal and no format arguments". p4raw-id: //depot/perl@34694
* Add MUTABLE_GV(), and eliminate (V *) casts in *.c.Nicholas Clark2008-10-311-2/+2
| | | | | | Can't easily do gv.h, as GvGP() (at least) needs to split into two macros - one const for reading, one non-const for writing. p4raw-id: //depot/perl@34679
* Eliminate (SV *) casts from sv.c and [tu]*.c, except for the cast inNicholas Clark2008-10-301-13/+13
| | | | | Perl_sv_magicext(), which is documented. p4raw-id: //depot/perl@34671
* Use pvs macros instead of pvn where possible.Marcus Holland-Moritz2008-10-291-1/+1
| | | p4raw-id: //depot/perl@34653
* Eliminate (AV *) casts in *.c.Nicholas Clark2008-10-291-1/+1
| | | p4raw-id: //depot/perl@34650
* Eliminate (HV *) casts in u*.c.Nicholas Clark2008-10-281-4/+4
| | | p4raw-id: //depot/perl@34624
* Update copyright years.Nicholas Clark2008-10-251-1/+1
| | | p4raw-id: //depot/perl@34585
* Create a direct lookup hash for ->isa() lookup, by retaining theNicholas Clark2008-09-121-22/+19
| | | | | | | | | | | de-duping hash used by S_mro_get_linear_isa_dfs(). Provide a new function Perl_get_isa_hash() to lazily retrieve this. (Which could actually be static if S_isa_lookup() and Perl_sv_derived_from() moved into mro.c.) Make S_isa_lookup() use this lookup hash in place of a linear walk of the linear isa. This should turn isa lookups from O(n) to O(1), which should make heavy users of ->isa() faster. (eg PPI, and hence Perl Critic). p4raw-id: //depot/perl@34354
* Abolish the warning "Can't locate package %"SVf" for the parents of %s"Nicholas Clark2008-09-111-8/+0
| | | | | | | which doesn't tell you anything you won't discover soon enough when you try to call a method. (Or haven't already been warned about when @ISA was linearised) p4raw-id: //depot/perl@34353
* As stash can't be NULL, no need to check name_stash is not NULL beforeNicholas Clark2008-09-111-1/+1
| | | | | comparing the two, as a NULL == NULL comparison can't happen. p4raw-id: //depot/perl@34352
* Use 1 line of code in place of 6 in Perl_sv_derived_from().Nicholas Clark2008-09-111-6/+1
| | | p4raw-id: //depot/perl@34350
* S_isa_lookup() no longer recurses (as of Brandon's MRO changes), so weNicholas Clark2008-09-111-3/+3
| | | | | don't need to pass in name_stash as a parameter. p4raw-id: //depot/perl@34349
* No, I didn't mean to commit the version *with* the abort(). It wasNicholas Clark2008-08-221-1/+0
| | | | | | meant to be removed once I'd proved it by running the tests without aborting. Oops. use more 'coffee'; p4raw-id: //depot/perl@34217
* Note that we have no test coverage for this particular warning.Nicholas Clark2008-08-221-0/+2
| | | p4raw-id: //depot/perl@34216
* Welcome to refcount hell. Fix the leaks reported by #57024Marcus Holland-Moritz2008-07-181-13/+10
| | | | | along with a bunch other named capture related leaks. p4raw-id: //depot/perl@34151
* Silence build warnings in universal.cJerry D. Hedden2008-05-231-1/+2
| | | | | | From: "Jerry D. Hedden" <jdhedden@cpan.org> Message-ID: <1ff86f510805211015m5c59bbf5wf3a992e776b1c4c4@mail.gmail.com> p4raw-id: //depot/perl@33910
* Make the worst case error message for Perl_croak_xs_usage() consistentNicholas Clark2008-05-211-1/+1
| | | | | with stringifying a code reference. p4raw-id: //depot/perl@33902
* Add Perl_croak_xs_usage(), which reduces a lot of explicit calls ofNicholas Clark2008-05-211-70/+71
| | | | | | | the form Perl_croak(aTHX_ "Usage %s::%s(%s)", "ouch" "awk", "eee_yow"); down to croak_xs_usage(cv, "eee_yow"); and refactor all the core XS code to use it. This adds () to the error messages for attributes::* p4raw-id: //depot/perl@33901
* assert() that every NN argument is not NULL. Otherwise we have theNicholas Clark2008-02-121-1/+7
| | | | | | | | | | | | ability to create landmines that will explode under someone in the future when they upgrade their compiler to one with better optimisation. We've already done this at least twice. (Yes, some of the assertions are after code that would already have SEGVd because it already deferences a pointer, but they are put in to make it easier to automate checking that each and every case is covered.) Add a tool, checkARGS_ASSERT.pl, to check that every case is covered. p4raw-id: //depot/perl@33291
* In XS_PerlIO_get_layers() take advantage of the implementation ofNicholas Clark2008-02-021-8/+13
| | | | | | PerlIO_get_layers(), by co-opting the new SVs it creates, rather than copying them. p4raw-id: //depot/perl@33182
* In XS_re_regexp_pattern(), use newSVpvn_flags() to avoid calls toNicholas Clark2008-02-021-7/+5
| | | | | sv_2mortal(). p4raw-id: //depot/perl@33181
* toke.c/universal.c: constingSteven Schubiger2008-01-291-2/+2
| | | | | Message-ID: <20080128125741.GA27390@refcnt.homeunix.org> p4raw-id: //depot/perl@33103
* Move re::regexp_pattern to universal.cJerry D. Hedden2008-01-091-0/+95
| | | | | | From: "Jerry D. Hedden" <jdhedden@cpan.org> Message-ID: <1ff86f510801081201q5c36f055re6165ebfe8876c2e@mail.gmail.com> p4raw-id: //depot/perl@32911
* Post change 32880, restore the dummy sub Regexp::DESTROY {}Nicholas Clark2008-01-071-0/+8
| | | p4raw-id: //depot/perl@32896
* Add macros mPUSHs() and mXPUSHs() for pushing SVs on the stackMarcus Holland-Moritz2008-01-041-10/+10
| | | | | | and mortalizing them. Use these macros where possible. And also mX?PUSH[inpu] where possible. p4raw-id: //depot/perl@32821
* Add newSVpvs_flags() as a wrapper to newSVpvn_flags(), and reworkNicholas Clark2008-01-031-2/+2
| | | | | sv_2mortal(newSVpvs(...)) constructions to use it. p4raw-id: //depot/perl@32819
* Forgot to remove dTARGET with change #32816.Marcus Holland-Moritz2008-01-031-1/+0
| | | | | p4raw-link: @32816 on //depot/perl: 1eb9e81d303aab0f6c2386f44bc76241948fce0f p4raw-id: //depot/perl@32817
* Fix memory leaks in XS_PerlIO_get_layers() by mortalizingMarcus Holland-Moritz2008-01-031-8/+8
| | | | | | all variables pushed on the stack. Also make sure the loop is using mXPUSHi() and not XPUSHi(). p4raw-id: //depot/perl@32816
* First class regexps.Nicholas Clark2007-12-281-8/+0
| | | p4raw-id: //depot/perl@32751
* use newSVpvs() on the constant string "isa", rather than newSVpv().Nicholas Clark2007-10-181-1/+1
| | | p4raw-id: //depot/perl@32134
* Rename various regex defined so that they have distinct prefixes based on ↵Yves Orton2007-06-281-8/+8
| | | | | | | | | | | | | | their usage. RXf_ => flags used in pm_flags argument to regcomp and stored in the regex via rx->extflags PREGf_ => flags stored in rx->intflags RXapif_ => argument flags for regex named capture api RX_BUFF_IDX_ => special indexes to represent $` $' $& used in the numeric capture buffer api PREGf is untouched by this change, but RXf_ is split into RXapif and RX_BUFF_IDX_. p4raw-id: //depot/perl@31497
* SvRX() and SvRXOK() macrosÆvar Arnfjörð Bjarmason2007-06-181-33/+8
| | | | | | From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com> Message-ID: <51dd1af80706172033h1908aa0ge15698204e0b79ed@mail.gmail.com> p4raw-id: //depot/perl@31409
* Make symbols short enough for VMS after #31341.Craig A. Berry2007-06-081-6/+6
| | | p4raw-id: //depot/perl@31358
* Silence compiler warningsJerry D. Hedden2007-06-071-0/+12
| | | | | | From: "Jerry D. Hedden" <jdhedden@cpan.org> Message-ID: <1ff86f510706061145r540c7f02kba96c04bc9dcf8b0@mail.gmail.com> p4raw-id: //depot/perl@31348
* Re: [PATCH] Callbacks for named captures (%+ and %-)Ævar Arnfjörð Bjarmason2007-06-061-160/+332
| | | | | | From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com> Message-ID: <51dd1af80706031324y5618d519p460da27a2e7fe712@mail.gmail.com> p4raw-id: //depot/perl@31341
* Remove unused parms in S_isa_lookupAndy Lester2007-05-091-6/+3
| | | | | Message-Id: <1CBA316A-EC1D-4E8F-8DEE-35322F390358@petdance.com> p4raw-id: //depot/perl@31185
* FETCH/STORE/LENGTH callbacks for numbered capture variablesÆvar Arnfjörð Bjarmason2007-05-031-1/+1
| | | | | | From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com> Message-ID: <51dd1af80705011658g1156e14cw4d2b21a8d772ed41@mail.gmail.com> p4raw-id: //depot/perl@31130