summaryrefslogtreecommitdiff
path: root/proto.h
Commit message (Collapse)AuthorAgeFilesLines
* utf8.c: Add _flags version of to_utf8_fold()Karl Williamson2011-05-031-8/+16
| | | | | | | | | | And also to_uni_fold(). The flag allows retrieving either simple or full folds. The interface is subject to change, so these are marked experimental and their names begin with underscore. The old versions are turned into macros calling the new versions with the correct extra parameter.
* embed.fnc: Allow NULL arg to to_utf8_case()Karl Williamson2011-05-031-3/+2
| | | | | | | Code within the function doesn't assume that the parameter is non-null, and in fact the specials are retrieved by swash_init(). Having the parameter null just means that no specials will be retrieved in the current call.
* Make push/shift $scalar accept only unblessed aryrefsFather Chrysostomos2011-04-181-6/+0
| | | | See ticket #80626.
* Add depth parameter to reg_namedseqKarl Williamson2011-03-201-1/+1
|
* regcomp.c: Avoid locale in optimizer unless necessaryKarl Williamson2011-03-171-6/+8
| | | | | | | | | | | | | | | | | | | | | | | This is further work along the lines in RT #85964 and commit af302e7fa58415c2d8454c8cbef7bccd8b504257. It reverts, for the the most part, commits aa19b56b2f07e9eabf57540f00d312d8093e9d28 (Remove unused parameter) and c613755a4b4fc8e64a77639d47d7e208fee68edc (/l in synthetic start class). Those commits caused the synthetic start class to often be marked as matching under locale rules, even if there was no part of the regular expression that used locale. This led to RT #85964, which made apparent that there were a number of assumptions in the optimizer about locale that were no longer necessarily true. This new commit changes things so that locale has to be somewhere in the regex in order to get the synthetic start class to include /l. In other words, this reverts the effect of those commits to regular expression which have /l -- we go back to the old way of doing things for non-locale regexes. This limits any bugs that may have been introduced by the addition of /l (and being able to match only sub-parts of a regex under locale) to the relatively uncommon regexes which actually use it. There are a number of bugs that have surfaced for the locale rules regexes that have gone unreported; and some say locale rules regexes should be deprecated.
* Revert "regcomp.c: Rmv unused parameter"Karl Williamson2011-03-171-3/+4
| | | | | This reverts commit c45df5a16bb5a26a06275cc63f2c3e6b1d708184. The parameter is about to be put back in.
* regcomp.c: Rmv unused parameterKarl Williamson2011-03-081-4/+3
| | | | This silences a compiler warning
* regcomp.c: Rmv unused parameterKarl Williamson2011-03-081-4/+3
| | | | This silences a compiler warning
* regcomp.c: Rmv unused parameterKarl Williamson2011-03-081-4/+3
| | | | This silences a compiler warning
* regcomp.c: Merge identical functionsKarl Williamson2011-03-081-6/+0
| | | | | These two functions now have identical code, so merge them, but use a macro in case they ever need to diverge again.
* Avoid miniperl SEGVing when processing -I on the #! lineNicholas Clark2011-03-051-7/+11
| | | | | | | | | | | | | | | | | | A side-effect of change 3185893b8dec1062 was to force av in S_incpush() to be NULL, whilst other flag variables were still set as if it were non-NULL, for certain cases, only when compiled with -DPERL_IS_MINIPERL The "obvious" fix is to also set all the flag variables to 0 under -DPERL_IS_MINIPERL, to make everything consistent. However, this confuses (at least) the local version of gcc, which issues warnings about passing a NULL value (av, known always to be NULL) as a not-NULL parameter, despite the fact that all the relevant calls are inside blocks which are actually dead code, due to the if() conditions being const variables set to 0 under -DPERL_IS_MINIPERL. So to avoid future bug reports about compiler warnings, the least worst thing to do seems to be to use #ifndef to use the pre-processor to eliminate the dead code, and related variables.
* regcomp.c: Add parameters to fcnsKarl Williamson2011-02-271-6/+8
| | | | | | A pointer to the list of multi-char folds in an ANYOF node is now passed to the routines that set the bit map. This is in preparation for those routines to add to the list
* regcomp.c: Add fcn add_cp_to_invlist()Karl Williamson2011-02-271-0/+3
| | | | | This is just an inline shorthand when a single code point is all that is needed. A macro could have been used instead, but this just seemed nicer.
* regcomp.c: Factor code into a function.Karl Williamson2011-02-271-0/+6
| | | | A future commit uses this same code, so put it into a common place.
* regcomp.c: accept NULL as inversion list paramKarl Williamson2011-02-271-5/+2
| | | | | | | Change the function add_range_to_invlist() to accept NULL as the inversion list, in which case it creates it. A common usage of this function is to create the list if it doesn't exist before calling it, so this just makes that code once.
* handy.h: isIDFIRST_utf8() changed to use XIDStartKarl Williamson2011-02-171-0/+12
| | | | | | | | | | Previously this used a home-grown definition of an identifier start, stemming from a bug in some early Unicode versions. This led to some problems, fixed by #74022. But the home-grown solution did not track Unicode, and allowed for characters, like marks, to begin words when they shouldn't. This change brings this macro into compliance with Unicode going-forward.
* foldEQ_utf8: Add version with flags parameterKarl Williamson2011-02-141-2/+6
| | | | | The parameter doesn't do anything yet. The old version becomes a macro calling the new version with 0 as the flags.
* regcomp.c: Put two static functions in embed.fncKarl Williamson2011-02-141-0/+14
|
* Fix up \cX for 5.14Karl Williamson2011-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Throughout 5.13 there was temporary code to deprecate and forbid certain values of X following a \c in qq strings. This patch fixes this to the final 5.14 semantics. These are: 1) a utf8 non-ASCII character will croak. This is the same behavior as pre-5.13, but it gives a correct error message, rather than the malformed utf8 message previously. 2) \c{ and \cX where X is above ASCII will generate a deprecated message. The intent is to remove these capabilities in 5.16. The original agreement was to croak on above ASCII, but that does violate our stability policy, so I'm deprecating it instead. 3) A non-deprecated warning is generated for all other \cX; this is the same as throughout the 5.13 series. I did not have the tuits to use \c{} as I had planned in 5.14, but \N{} can be used instead.
* Move grok_bslash_c to dquote.c and make staticKarl Williamson2011-02-091-3/+3
| | | | No other changes were made
* Move grok_blsash_o and make staticKarl Williamson2011-02-091-9/+9
| | | | | | This function is only used in the same places as dquote_static.c is used, so move it there, and we won't have to worry about changing its API will break something. No other changes made
* regcomp: Add/subtract consts to match embed.fncKarl Williamson2011-02-061-1/+1
|
* Add initial inversion list objectKarl Williamson2011-02-021-1/+84
| | | | | | | | | | | | | | | Going forward the intent is to convert from swashes to the better-suited inversion list data structure. This adds rudimentary inversion lists that have only the functionality needed for 5.14. As a result, they are as much as possible static to one file. What's necessary for 5.14 is enough to allow folding of ANYOF nodes to be moved from regexec to regcomp. Why they are needed for that is to generate as compact as possible class definitions; otherwise, very long linear lists might be generated. (They still may be, but that's inherent in the problem domain; this generates as compact as possible, combining overlapping ranges, etc.) The only two non-trivial methods in this object are from published algorithms.
* Use embed.pl inline capabilities for regcurlyKarl Williamson2011-01-291-0/+9
| | | | Change the regcurly definition to use the new inline abilities.
* Break out the generated function Perl_keywords() into keywords.c, a new file.Nicholas Clark2011-01-241-5/+5
| | | | | | | | As it and Perl_yylex() both need FEATURE_IS_ENABLED, feature_is_enabled() is no longer static, and the two macro definitions move from toke.c to perl.h Previously, one had to cut and paste the output of perl_keywords.pl into the middle of toke.c, and it was not clear that it was generated code.
* Change close_and_rename() to read_only_bottom_close_and_rename()Nicholas Clark2011-01-231-0/+1
| | | | | | | | | | All users of close_and_rename() were printing out the appropriate "ex: set ro:" string to the file handle immediately before closing it. So move that into the common function and rename it to reflect what it now does. [Except overload.pl, which should have been, given that it calls read_only_top()] Print a newline above the "ex: set ro:" line. This removes many newlines from the regen scripts, but does add newlines to a couple of generated files.
* Move all the generated file header printing into read_only_top()Nicholas Clark2011-01-231-4/+4
| | | | | | | | | Previously all the scripts in regen/ had code to generate header comments (buffer-read-only, "do not edit this file", and optionally regeneration script, regeneration data, copyright years and filename). This change results in some minor reformatting of header blocks, and standardises the copyright line as "Larry Wall and others".
* Add check_utf8_print()Karl Williamson2011-01-091-0/+5
| | | | | | | This new function looks for problematic code points on output, and warns if any are found, returning FALSE as well. What it warns about may change, so is marked as experimental.
* regen/opcode.pl should only generate prototypes for pp_* functions that exist.Nicholas Clark2011-01-091-1/+0
| | | | | | | It now generates prototypes for all functions that implement OPs. Hence Perl_unimplemented_op no longer needs a special-case prototype. As it is now generating a prototype for Perl_do_kv, no need for regen/embed.pl to duplicate this. Convert the last two users of the macro do_kv() to Perl_do_kv(aTHX).
* Generate pp_* prototypes in pp_proto.h, and remove pp.symNicholas Clark2011-01-091-366/+4
| | | | | | | | | | | Eliminate the #define pp_foo Perl_pp_foo(pTHX) macros, and update the 13 locations that relied on them. regen/opcode.pl now generates prototypes for the PP functions directly, into pp_proto.h. It no longer writes pp.sym, and regen/embed.pl no longer reads this, removing the only ordering dependency in the regen scripts. opcode.pl is now responsible for prototypes for pp_* functions. (embed.pl remains responsible for ck_* functions, reading from regen/opcodes)
* Rename tied_handle_method() to tied_method(), and make it non-static.Nicholas Clark2011-01-051-8/+8
| | | | It can be used for (at least) the call to "SPLICE" from pp_splice.
* The mg parameter to S_tied_handle_method() can be const MG *Nicholas Clark2011-01-051-1/+1
|
* Split the flags and argc parameters to S_tied_handle_method().Nicholas Clark2011-01-051-1/+1
| | | | | Previously they were combined into one numeric value, using a bitshift. This was a false economy.
* [perl #36347] Object destruction incompleteFather Chrysostomos2011-01-021-0/+5
| | | | | | | | | | | | | | | | | | | do_clean_objs only looks for objects referenced by RVs, so blessed array references and lexical variables (and probably other SVs, too) are not DESTROYed. This commit adds a new visit() call to sv_clean_objs, which curses (DESTROYs and un-blesses, leaving the reference count as it is) any objects that are still left after do_clean_named_io_objs. The new do_curse routine (a pointer to which is passeds to visit()) follows do_clean_named_io_objs’ example and explicitly skips the STDOUT and STDERR handles, in case destructors need to use them. The cursing code, which is now called from two places, is moved out of sv_clear and put in its own routine. The check that the reference count is zero does not apply when called from sv_clean_objs, so the new S_curse routine takes a boolean argument that determines whether that check should take place.
* Argument op to report_evil_fh() is always PL_op->op_type, so need not be passedNicholas Clark2010-12-281-1/+1
|
* The io argument to report_evil_fh() is always GvIO(gv), so need not be passed.Nicholas Clark2010-12-281-1/+1
|
* Extract the OP_phoney_* code from report_evil_fh() into report_wrongway_fh()Nicholas Clark2010-12-281-0/+1
| | | | | Previously Perl_report_evil_fh()'s body was just an if/else at the top level - a good sign that it is actually implementing two disjoint functions.
* Move do_chomp() from pp.c to doop.c, and make it static.Nicholas Clark2010-12-271-6/+6
| | | | It was never part of the public API, and only ever used by pp_{s,}cho{,m}p.
* Merge Perl_do_chop() and Perl_do_chomp().Nicholas Clark2010-12-271-8/+2
| | | | | | They share code for dealing with PVAVs, PVHVs, read only values and handling PL_encoding. They are not part of the public API, and Google codesearch shows no users outside the core.
* Convert Perl_do_chomp() to the same prototype as Perl_do_chop().Nicholas Clark2010-12-271-3/+4
| | | | Pass in an SV to hold the count, rather than returning the count.
* recursive-descent expression parsingZefram2010-12-111-0/+4
| | | | | | New API functions parse_fullexpr(), parse_listexpr(), parse_termexpr(), and parse_arithexpr(), to parse an expression at various precedence levels.
* Add mg_findextFlorian Ragwitz2010-11-301-0/+3
|
* Add sv_unmagicextFlorian Ragwitz2010-11-301-0/+5
|
* Add Perl_foldEQ_latin1()Karl Williamson2010-11-281-0/+7
| | | | | | | | | | This function compares two non-utf8 strings to see if they are equivalent without regards to case differences. It does not work nor check for three problematic code points that require special handling: MICRO_SIGN, LATIN_SMALL_LETTER_SHARP_S, and LATIN_SMALL_LETTER_Y_WITH_DIAERESIS. make regen required
* [perl #78908] Reinstate mod for one more stable releaseFather Chrysostomos2010-11-261-0/+1
|
* Deprecate sv_compile_2op()Nicholas Clark2010-11-241-0/+9
| | | | | | | | | It attempted to provide an API to compile code down to an optree, but failed to bind correctly to lexicals in the enclosing scope. It's not possible to fix this problem within the constraints of its parameters and return value. Searches suggest +that nothing on CPAN is using it, so removing it should have zero impact.
* mro_package_moved must act on all effective namesFather Chrysostomos2010-11-221-2/+2
| | | | | | | | | | | | See the test case in the commit. It passes in 5.8.x and blead (as of this commit), but not 5.10-5.13.7. In every case the name to be passed to mro_gather_and_rename is cre- ated using an SV, so we might as well pass that instead of extracting the char array and length from it. That allows us to pass an AV instead, if there are multiple names to take into account.
* Add flags param to hv_ename_*Father Chrysostomos2010-11-201-2/+2
| | | | | We will need this for making the API UTF8-aware in 5.16 or whenever.
* Eliminate the newname param from mro_package_movedFather Chrysostomos2010-11-201-1/+5
| | | | Nothing is using this any more, as of the previous commit.
* hv_undef .= _flagsFather Chrysostomos2010-11-201-1/+2
| | | | | | | Add flags param to hv_undef. There is no mathom, as the changes that this will support are by no means suitable for maint.