summaryrefslogtreecommitdiff
path: root/embed.fnc
Commit message (Collapse)AuthorAgeFilesLines
* Add utf8_to_utf16Karl Williamson2021-08-141-0/+2
|
* Improve utf16_to_utf8_reversed()Karl Williamson2021-08-141-2/+4
| | | | | | Instead of destroying the input by first swapping the bytes, this calls a base function with the order to use. The non-reverse function is changed to call the base function with the non-reversed order.
* utf8.c: Refactor is_utf8_char_helper()Karl Williamson2021-08-141-1/+1
| | | | | | | | | Now that the DFA is used by the only callers to this to eliminate the need to check for e.g., wrong continuation bytes, this function can be refactored to use a switch statement, which makes it clearer, shorter, and faster. The name is changed to indicate its private nature
* Make macro isUTF8_CHAR_flags an inline fcnKarl Williamson2021-08-141-0/+3
| | | | This makes it use the fast DFA for this functionality.
* is_utf8_valid_partial_char_flags: Use DFAKarl Williamson2021-08-141-2/+2
| | | | | | | | The DFA macro for determining if a sequence is valid UTF-8 was deliberately made general enough to accommodate this use-case, in which only a partial character is acceptable. Change the code to use the DFA. The helper function's name is changed to indicate it is private
* utf8.c: Rename formal param to static fcnKarl Williamson2021-08-071-1/+1
| | | | The new mname is more mnemonic
* uvoffuni_to_utf8_flags_msgs: Avoid extra conditionalsKarl Williamson2021-08-071-1/+1
| | | | | | | The previous commit for EBCDIC paved the way for moving some checks for a code point being for Perl extended UTF-8 out of places where they cannot succeed. The resultant simplifications more than compensate for the two extra case statements added by this commit.
* utf8.c: Change formal parameter name to fcnKarl Williamson2021-08-071-1/+1
| | | | This will make more sense of the next commit
* Add helper function for longest UTF8 sequenceKarl Williamson2021-08-071-0/+3
| | | | | | | | | This specialized functionality is used to check the validity of Perl's extended-length UTF-8, which has some ideosyncratic characteristics from the shorter sequences. This means this function doesn't have to consider those differences. It will be used in the next commit to avoid some work, and to eventually enable is_utf8_char_helper() to be simplified.
* utf8.c: Fold 2 overlapping fcns into oneKarl Williamson2021-08-071-5/+0
| | | | | | | | One of these functions is now only called from the other, and there is significant overlap in their logic. This commit refactors them into one resulting function, which is half the code, and more straight forward.
* utf8.c: Generalize static fcnKarl Williamson2021-08-071-2/+2
| | | | | | | | | I've always been uncomfortable with the input constraints this function had. Now that it has been refactored into using a switch(), new cases for full generality can be added without affecting performance, and some conditionals removed before calling it. The function is renamed to reflect its more generality
* utf8.c: Change name of static functionKarl Williamson2021-08-071-1/+1
| | | | | This changes only portions of the capitalization, and the new version is more in keeping with other function names.
* av_create_and_push/unshift_one: remove experimental flagRichard Leach2021-07-311-2/+2
|
* Create and use 32 and 64 bit msbit_pos() fcnsKarl Williamson2021-07-301-0/+2
| | | | | | | | | | | | | The existing code to determine the position of the most significant 1 bit in a word is extracted from variant_byte_number(), and generalized to use the deBruijn method previously added that works on any bit in the word, rather than the existing method which looks just at the msb of each byte. The code is moved to a new function in preparation for being called from other places. A U32 version is created, and on 64 bit platforms, a second, parallel, version taking a U64 argument is also created. This is because future commits may care about the word size differences.
* Create and use 32 and 64 bit lsbit_pos() fcnsKarl Williamson2021-07-301-0/+2
| | | | | | | | | | The existing code to determine the position of the least significant 1 bit in a word is extracted from variant_byte_number() and moved to a new function in preparation for being called from other places. A U32 version is created, and on 64 bit platforms, a second, parallel, version taking a U64 argument is also created. This is because future commits may care about the word size differences.
* Add 64bit single-1bit_pos()Karl Williamson2021-07-301-0/+3
| | | | | | | | | | | | | This will prove useful in future commits on platforms that have 64 bit capability. The deBruijn sequence used here, taken from the internet, differs from the 32 bit one in how they treat a word with no set bits. But this is considered undefined behavior, so that difference is immaterial. Apparently figuring this out uses brute force methods, and so I decided to live with this difference, rather than to expend the time needed to bring them into sync.
* Create and use single_1bit_pos32()Karl Williamson2021-07-301-0/+1
| | | | | | This moves the code from regcomp.c to inline.h that calculates the position of the lone set bit in a U32. This is in preparation for use by other call sites.
* Add inline av_fetch_simple and av_store_simple functionsRichard Leach2021-07-031-0/+2
|
* Rename scalarseq() to a somewhat more meaningful voidnonfinal()Paul "LeoNerd" Evans2021-06-161-1/+1
|
* replace all instances of PERL_IMPLICIT_CONTEXT with MULTIPLICITYTomasz Konojacki2021-06-091-2/+2
| | | | | | | | | | | | Since the removal of PERL_OBJECT (acfe0abcedaf592fb4b9cb69ce3468308ae99d91) PERL_IMPLICIT_CONTEXT and MULTIPLICITY have been synonymous and they're being used interchangeably. To simplify the code, this commit replaces all instances of PERL_IMPLICIT_CONTEXT with MULTIPLICITY. PERL_IMPLICIT_CONTEXT will stay defined for compatibility with XS modules.
* Call magic on all elements on %SIG delocalizationLeon Timmermans2021-06-021-0/+1
|
* regcomp.c: Extract code from a too-large-functionKarl Williamson2021-05-311-0/+10
| | | | | S_regclass() is unwieldy. This commit splits it into two nearly equal size parts. More could be done.
* Add Perl_av_new_alloc() function and newAV_alloc_x/z() macrosRichard Leach2021-05-261-0/+3
|
* Do not cache utf8 offsets for non-canonical lengthsLeon Timmermans2021-05-241-1/+1
| | | | In particular, if the length is beyond the end, it should not be stored as the end.
* Document gv_stashsvpvn_cachedKarl Williamson2021-04-141-1/+1
|
* embed.fnc: White space onlyKarl Williamson2021-03-031-2/+2
|
* embed.fnc: Add clarifying commentKarl Williamson2021-03-021-1/+4
|
* try isn't treated as a sub call like eval isTony Cook2021-02-141-0/+1
| | | | | | | | | | | | | The try change added code to pp_return to skip past try contexts when looking for the sub/sort/eval context to return from. This was only needed because cx_pusheval() sets si_cxsubix to the current frame and try uses that function to push it's context, that value is then used by the dopopto_cursub() macro to shortcut walking the context stack. Since we don't need to treat try as a sub for return, list vs array checks or lvalue sub checks, don't set si_cxsubix on try.
* Add a newTRYCATCHOP(); migrate the custom code out of perly.y into itPaul "LeoNerd" Evans2021-02-141-0/+1
|
* regexec.c: Make internal function staticKarl Williamson2021-02-101-2/+2
| | | | | This used to be called from utf8.c, but no longer; no need to make it other than static. This allows the compiler to better optimize.
* Allow blanks within and adjacent to {...} constructsKarl Williamson2021-01-201-1/+1
| | | | | This was the consensus in http://nntp.perl.org/group/perl.perl5.porters/258489
* Allow empty lower bound in /{,n}/Karl Williamson2021-01-201-1/+0
| | | | | | | | This change has been planned for a long time, bringing Perl into parity with similar languages, but it took many deprecation cycles to be able to reach the point where it could safely go in. This fixes GH #18264
* Revamp regcurly(), regpiece() use of itKarl Williamson2021-01-201-1/+3
| | | | | | | | | | | | | | | | | | | | This commit copies portions of new_regcurly(), which has been around since 5.28, into plain regcurly(), as a baby step in preparation for converting entirely to the new one. These functions are used for parsing {m,n} quantifiers. Future commits will add capabilities not available using the old version. The commit adds an optional parameter, to return to the caller information it gleans during parsing. regpiece() is changed by this commit to use this information, instead of itself reparsing the input. Part of the reason for this commit is that changes are planned soon to what is legal syntax. With this commit in place, those changes only have to be done once. This commit also extracts into a function the calculation of the quantifier bounds. This allows the logic for that to be done in one place instead of two.
* add a bareword_filehandles feature, which is enabled by defaultTony Cook2021-01-041-0/+1
| | | | This disables use of bareword filehandles except for the built-in handles
* perlapi: Consolidate newRV and newRV_inc podKarl Williamson2020-12-301-1/+1
|
* Document gv_autoload4Karl Williamson2020-12-271-1/+1
|
* Document safesys...alloc fcns; safesysfreeKarl Williamson2020-12-271-4/+4
|
* Document gv_fetchfile(_flags)?Karl Williamson2020-12-271-2/+2
|
* embed.fnc: Mark gv_check as internalKarl Williamson2020-12-271-1/+1
| | | | | The purpose of this function is to raise a parse warning; not something something outside core should be doing.
* newSVsv_flags is now documentedKarl Williamson2020-12-241-1/+1
|
* embed.fnc: Mark several do_dump fcns as Core onlyKarl Williamson2020-12-201-9/+9
| | | | | These appear to be helper functions for various API functions; there are no uses of them in cpan
* embed.fnc: Mark sv_2uv, etc. as Core onlyKarl Williamson2020-12-201-4/+4
| | | | | There are documented macros that one is supposed to use instead for this functionality.
* embed.fnc: Mark stack_grow as Core onlyKarl Williamson2020-12-201-1/+1
| | | | | This is a helper function used by such things as SSGROW; there is no cpan usage
* embed.fnc: Mark scan_num as Core onlyKarl Williamson2020-12-201-1/+1
| | | | This is used by the toker to scan a number; there is no cpan usage
* embed.fnc: Mark cx_dump as Core onlyKarl Williamson2020-12-201-1/+1
| | | | This appears to be for internal debugging; there is no cpan usage
* embed.fnc: Mark av_arylen_p, av_iter_p as Core onlyKarl Williamson2020-12-201-2/+2
| | | | | | These appear to be internal functions, and there is no cpan usage The macro GIMME_V is what one is supposed to use for this functionality.
* embed.fnc: Mark doing_taint as Core onlyKarl Williamson2020-12-201-1/+1
| | | | This appears to be for internal use, and there are no cpan usages
* embed.fnc: Mark cxinc as Core onlyKarl Williamson2020-12-201-1/+1
| | | | | The macro CXINC is what one is supposed to use for this functionality. (though it is currently undocumented)
* embed.fnc: Mark moreswitches as Core onlyKarl Williamson2020-12-201-1/+1
| | | | | This is an internal function used to parse command line options; there are no cpan uses.
* embed.fnc: Mark runops_debug, runops_standard as Core onlyKarl Williamson2020-12-201-2/+2
| | | | These are internal functions to run the program; there are no cpan uses