summaryrefslogtreecommitdiff
path: root/proto.h
Commit message (Collapse)AuthorAgeFilesLines
* Regen headers after previous patchesRafael Garcia-Suarez2010-02-191-6/+7
|
* Convert Perl_sv_pos_u2b_proper() to Perl_sv_pos_u2b_flags().Nicholas Clark2010-02-141-4/+4
| | | | | | | Change from a value/return offset pointer to passing a Unicode offset, and returning a byte offset. The optional length value/return pointer remains. Add a flags argument, passed to SvPV_flags(). This allows the caller to specify whether mg_get() should be called on sv.
* Removes 32-bit limit on substr arguments. The full range of IV and UV is ↵Eric Brine2010-02-141-0/+5
| | | | available for the pos and len arguments, with safe conversion to STRLEN where it's smaller than an IV.
* Qualify pointer arguments of prescan_version in embed.fncRafael Garcia-Suarez2010-01-151-1/+1
|
* Omnibus strict and lax version parsingDavid Golden2010-01-131-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* qr/\X/ expansionKarl Williamson2009-12-051-0/+60
|
* cleanup get_arena param-names, mark as May-ChangeJim Cromie2009-11-241-1/+1
| | | | | new param-names reflect actual usage. Mark as may-change so we can add a reqid field later.
* Move change c35076938c7236fb into embed.fnc, from the generated file proto.hNicholas Clark2009-11-231-1/+1
|
* Perl_pad_sv and Perl_hv_assert don't exist without -DDEBUGGING.Craig A. Berry2009-11-211-0/+4
| | | | So let's not make them part of the API when they don't exist.
* lexer APIZefram2009-11-151-0/+31
| | | | | | | | | Attached is a patch that adds a public API for the lowest layers of lexing. This is meant to provide a solid foundation for the parsing that Devel::Declare and similar modules do, and it complements the pluggable keyword mechanism. The API consists of some existing variables combined with some new functions, all marked as experimental (which making them public certainly is).
* Change S_pad_check_dup()'s arguments from char*/STRLEN to SV *.Nicholas Clark2009-11-151-1/+1
| | | | Within the function, use sv_eq() rather than strcmp().
* Convert pad_check_dup() to static linkage, and call it from Perl_pad_add_name().Nicholas Clark2009-11-151-4/+5
| | | | | Provide a flag option to Perl_pad_add_name(), pad_add_NO_DUP_CHECK, to supress the call.
* Refactor common code paths from Perl_pad_add_name() into S_pad_add_name_sv().Nicholas Clark2009-11-151-0/+5
| | | | | | The only user of the pad_add_FAKE flag was S_pad_findlex(), so move the relevant code there from Perl_pad_add_name(), and have S_pad_findlex() call S_pad_add_name_sv() directly. This eliminates the pad_add_FAKE flag completely.
* Factor the "is this an in-place array operator construct" logic into a new ↵Vincent Pit2009-11-101-0/+5
| | | | is_inplace_av()
* Add length and flags arguments to Perl_pad_add_name().Nicholas Clark2009-11-091-1/+1
| | | | | | Currently only pad_add_STATE and pad_add_FAKE are used. The length is cross- checked against strlen() on the pointer, but the intent is to re-work the entire pad API to be UTF-8 aware, from the current situation of char * pointers only.
* Add length and flags arguments to Perl_pad_check_dup().Nicholas Clark2009-11-091-2/+2
| | | | | | Currently only pad_add_OUR is used. The length is cross-checked against strlen() on the pointer, but the intent is to re-work the entire pad API to be UTF-8 aware, from the current situation of char * pointers only.
* Add length and flags arguments to Perl_allocmy().Nicholas Clark2009-11-091-1/+1
| | | | | | Currently no flags bits are used, and the length is cross-checked against strlen() on the pointer, but the intent is to re-work the entire pad API to be UTF-8 aware, from the current situation of char * pointers only.
* Bareword sub lookupsZefram2009-11-081-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Attached is a patch that changes how the tokeniser looks up subroutines, when they're referenced by a bareword, for prototype and const-sub purposes. Formerly, it has looked up bareword subs directly in the package, which is contrary to the way the generated op tree looks up the sub, via an rv2cv op. The patch makes the tokeniser generate the rv2cv op earlier, and dig around in that. The motivation for this is to allow modules to hook the rv2cv op creation, to affect the name->subroutine lookup process. Currently, such hooking affects op execution as intended, but everything goes wrong with a bareword ref where the tokeniser looks at some unrelated CV, or a blank space, in the package. With the patch in place, an rv2cv hook correctly affects the tokeniser and therefore the prototype-based aspects of parsing. The patch also changes ck_subr (which applies the argument context and checking parts of prototype behaviour) to handle subs referenced by an RV const op inside the rv2cv, where formerly it would only handle a gv op inside the rv2cv. This is to support the most likely kind of modified rv2cv op. The attached patch is the resulting revised version of the bareword sub patch. It incorporates the original patch (allowing rv2cv op hookers to control prototype processing), the GV-downgrading addition, and a mention in perldelta.
* Add length and flags arguments to Perl_pad_findmy(), moving it to the public ↵Nicholas Clark2009-11-071-1/+1
| | | | | | | | API. Currently no flags bits are used, and the length is cross-checked against strlen() on the pointer, but the intent is to re-work the entire pad API to be UTF-8 aware, from the current situation of char * pointers only.
* move JMPENV_JUMP to die_where and mark it as "noreturn"Gerard Goossen2009-11-061-1/+3
|
* regen generated files changed by the previous patch - facility to plug in ↵Jesse Vincent2009-11-051-0/+7
| | | | syntax triggered by keywords
* Remove Perl_pmflag() from the public API, and mark it as deprecated.Nicholas Clark2009-11-011-1/+2
| | | | | | regcomp.c stopped using it before 5.10, leaving only toke.c. The only code on CPAN that uses it is copies of regcomp.c. Replace it with a static function, with a cleaner interface.
* Use of SV* instead of message, msglen, utf8 to contain error messageGerard Goossen2009-11-011-5/+5
|
* RT#69616: regexp SVs lose regexpness in assignmentBen Morrow2009-10-221-3/+3
| | | | | | | | It uses reg_temp_copy to copy the REGEXP onto the destination SV without needing to copy the underlying pattern structure. This means changing the prototype of reg_temp_copy, so it can copy onto a passed-in SV, but it isn't API (and probably shouldn't be exported) so I don't think this is a problem.
* Remove the PERLIO * argument to S_filter_gets(), as it's always PL_rsfpNicholas Clark2009-10-211-4/+3
| | | | | | | | Conceptually it's also wrong, as if there are source filters, the passed-in file handle is not passed up the stack of filters for the topmost filter to use to read from. It was in the parameter list from the first creation of filter_gets() in 16d20bd98cd29be76029ebf04027a7edd34d817b, when calls to sv_gets() were replaced by it.
* Pull out filter setup code from S_swallow_bom() into S_add_utf16_textfilter()Nicholas Clark2009-10-201-0/+5
|
* somewhat fix failing regex tests. but break lots of other stuff at the same timeYves Orton2009-10-191-0/+18
|
* Merge S_utf16_textfilter and S_utf16rev_textfilter().Nicholas Clark2009-10-181-5/+0
| | | | Use IoLINES() on the filter's SV to determine which encoding is in use.
* Generate prototypes for utf16_textfilter and utf16rev_textfilter using embed.fncNicholas Clark2009-10-181-0/+12
|
* Optimise if (%foo) to be faster than if(keys %foo)demerphq2009-10-151-0/+7
| | | | | | | | | | | Thread was "[PATCH] Make if (%hash) {} act the same as if (keys %hash) {}" http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-11/msg00432.html but the implementation evolved from the approach described in the subject, to instead add a new opcode pp_boolkeys, to exactly preserve the existing behaviour. Various conflicts with the passage of time resolved, 'register' removed, and a $VERSION bump.
* Migrate common code in Perl_ckwarn() and Perl_ckwarn_d() to S_ckwarn_common()Nicholas Clark2009-10-131-0/+3
|
* Replace Perl_deprecate() with a macro that calls Perl_ck_warner()Nicholas Clark2009-10-131-5/+0
| | | | | | Perl_deprecate was not part of the public API, and did not have a deprecate() shortcut macro defined without -DPERL_CORE. Neither codesearch.google.com nor CPAN::Unpack show any users outside the core.
* Move the code related to deprecate("comma-less variable list") into a function.Nicholas Clark2009-10-131-0/+1
| | | | This makes all calls to deprecate() string constants.
* Use deprecate() in place of deprecate_old(), and remove S_deprecate_old().Nicholas Clark2009-10-131-7/+0
|
* Add Perl_ck_warner_d(), which combines Perl_ckwarn_d() and Perl_warner().Nicholas Clark2009-10-121-0/+6
| | | | | Replace ckWARN_d{,2,3,4}() && Perl_warner() with it, which trades reduced code size for 1 more function call if warnings are not enabled.
* Add Perl_ck_warner(), which combines Perl_ckwarn() and Perl_warner().Nicholas Clark2009-10-121-0/+6
| | | | | | | Replace ckWARN{,2,3,4}() && Perl_warner() with it, which trades reduced code size (about 0.2%), for 1 more function call if warnings are not enabled. However, if we're now in the L1 or L2 cache when we weren't previously, that's still going to be a speed win.
* deprecate_old() is not public, and only used within toke.c, so can be static.Nicholas Clark2009-10-121-1/+3
|
* Add 'package NAME VERSION' syntaxDavid Golden2009-10-061-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for setting the $VERSION of a namespace when the namespace is declared with 'package'. It eliminates the need for 'our $VERSION = ...' and similar constructs. E.g. package Foo::Bar 1.23; # $Foo::Bar::VERSION == 1.23 There are several advantages to this: * VERSION is parsed in *exactly* the same way as 'use NAME VERSION' * $VERSION is set at compile time * Eliminates '$VERSION = ...' and 'eval $VERSION' clutter * As it requires VERSION to be a numeric literal or v-string literal, it can be statically parsed by toolchain modules without 'eval' the way MM->parse_version does for '$VERSION = ...' * Alpha versions with underscores do not need to be quoted; static parsing will preserve the underscore, but during compilation, Perl will remove underscores as it does for all numeric literals During development of this, there was discussion on #corehackers and elsewhere that this should also allow other metadata to be set such as "status" (stable/alpha) or "author/authority". On reflection, those metadata are not very well defined yet and likely should never be encoded into Perl core parsing so they can be freely changed in the future. (They could perhaps be achieved via a comment on the same line as 'package NAME VERSION'.) Version numbers, however, already have a very specific definition and use defined in the core through 'use NAME VERSION'. This patch merely provides appropriate symmetry for setting $VERSION with the exact same parsing and semantics as 'use'. It does not break old code with only 'package NAME', but code that uses 'package NAME VERSION' will need to be restricted to perl 5.11.X. This is analogous to the change to open() from two-args to three-args. Users requiring the latest Perl will benefit, and perhaps N years from now it will become standard practice when Perl 5.12 is targeted the way that 5.6 is today. The patch does not prevent 'package NAME VERSION' from being used multiple times for the same package with different version numbers, but nothing prevents $VERSION from being modified arbitrarily at runtime, either, so I see no urgen reason to add limitations or warnings so long as Perl uses a global $VERSION variable for package version numbers. I am posting this patch to the p5p list for discussion and review. If there seems to be general assent (or lack of dissent), I will go ahead and commit the patch to blead.
* Fix the build for -Dmad - f0e3f042f14b829f missed a couple of things.Nicholas Clark2009-09-141-1/+1
|
* Remove obsolete functions is_uni_alnumc, is_uni_alnumc_lc, is_utf8_alnumcRafael Garcia-Suarez2009-09-131-14/+0
|
* finish implementing -DB vs. -DxChip Salzenberg2009-08-301-0/+22
|
* Speed up repeatcpy() by at least 40% for 1-char or numerous repeatsVincent Pit2009-08-271-3/+3
| | | | | | | | | | | | And don't make it receive the interpreter anymore. For 1-char repeats, use memset(). Otherwise, use the old implementation up to some (small) length, and then use memcpy() in a binary manner, based on what we previously copied. Note that we use memcpy() so both strings shouldn't overlap. The previous implementation didn't allow this as well. This would be a good place to use the restrict keyword from C99. I'm not sure if Configure has a probe for it.
* delimcopy(), ibcmp(), ibcmp_locale(), instr(), ninstr() and rninstr() from ↵Vincent Pit2009-08-271-25/+25
| | | | util.c don't need the interpreter as well
* Don't pass the the interpreter to is_ascii_string(), is_utf8_char(), ↵Vincent Pit2009-08-271-10/+10
| | | | is_utf8_string(), is_utf8_string_loclen() as they don't need it
* In C<use utf8; a=>'b'>, do not set utf8 flag on 'a' [perl #68812]Chip Salzenberg2009-08-261-0/+5
|
* Use less constness in MAD codeRafael Garcia-Suarez2009-08-261-1/+1
| | | | This suppresses warnings, because sometimes the constness was taken away
* Add clear magic to %^H so that the HE chain is reset when you empty it.Zefram2009-08-211-0/+6
| | | | This fixes [perl #68590] : %^H not lexical enough.
* Perl_die_nocontext() is also called with NULL from XS extensions that want ↵Vincent Pit2009-08-131-4/+1
| | | | | | to set $@ themselves. This commit goes with 52a5bfab8876f302d269f1bfa46eae1998f0d3ca.
* Merge gv_IOadd() into gv_add_by_type().Nicholas Clark2009-08-081-21/+5
|
* Perl_newIO() can become a mathom by making newIO() a wrapper around newSV_type()Nicholas Clark2009-08-081-2/+2
| | | | and tweaking Perl_sv_upgrade().