summaryrefslogtreecommitdiff
path: root/dquote_static.c
Commit message (Collapse)AuthorAgeFilesLines
* PERL_UNUSED_CONTEXT -> remove interp context where possibleDaniel Dragan2014-06-241-2/+1
| | | | | | | | | | | | | | | | | | | | | Removing context params will save machine code in the callers of these functions, and 1 ptr of stack space. Some of these funcs are heavily used as mg_find*. The contexts can always be readded in the future the same way they were removed. This patch inspired by commit dc3bf40570. Also remove PERL_UNUSED_CONTEXT when its not needed. See removal candidate rejection rational in [perl #122106]. -Perl_hv_backreferences_p uses context in S_hv_auxinit commit 96a5add60f was wrong -Perl_whichsig_sv and Perl_whichsig_pv wrongly used PERL_UNUSED_CONTEXT from inception in commit 84c7b88cca -in authors opinion cast_* shouldn't be public API, no CPAN grep usage, can't be static and/or inline optimized since it is exported -Perl_my_unexec move to block where it is needed, make Win32 block, context free, for inlining likelyhood, private api and only 2 callers in core -Perl_my_dirfd make all blocks context free, then change proto -Perl_bytes_cmp_utf8 wrongly used PERL_UNUSED_CONTEXT from inception in commit fed3ba5d6b
* Deprecate unescaped literal "{" in regex patternsKarl Williamson2014-06-121-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit also causes escaped (by a backslash) "(", "[", and "{" to be considered literally. In the previous 2 Perl versions, the escaping was ignored, and a (default-on) deprecation warning was raised. Now that we have warned for 2 release cycles, we can change the meaning.of escaping to actually do something Warning when a literal left brace is not escaped by a backslash, will allow us to eventually use this character in more contexts as being meta, allowing us to extend the language. For example, the lower limit of a quantifier could be omited, and better error checking instituted, or things like \w could be followed by a {...} indicating some special word character, like \w{Greek} to restrict to just Greek word characters. We tried to do this in v5.16, and many CPAN modules changed to backslash their left braces at that time. However we had to back out that change before 5.16 shipped because it turned out that escaping a left brace in some contexts didn't work, namely when the brace would normally be a metacharacter (for example surrounding a quantifier), and the pattern delimiters were { }. Instead we raised the useless backslash warning mentioned above, which has now been there for the requisite 2 cycles. This patch partially reverts 2 patches. The first, e62d0b1335a7959680be5f7e56910067d6f33c1f, partially reverted the deprecation of unescaped literal left brace. The other, 4d68ffa0f7f345bc1ae6751744518ba4bc3859bd, instituted the deprecation of the useless left-characters. Note that, as in the original attempt to deprecate, we don't raise a warning if the left brace is the first character in the pattern. This is because in that position it can't be a metacharacter, so we don't require any disambiguation, and we found that if we did raise an error, there were quite a few places where this occurred.
* Silence several -Wunused-parameter warnings about my_perlBrian Fraser2014-06-131-0/+1
| | | | | | | | This meant sprinkling some PERL_UNUSED_CONTEXT invocations, as well as stopping some functions from getting my_perl in the first place; all of the functions in the latter category are internal (S_ prefix and s or i in embed.fnc), so this should be both safe and economical.
* dquote_static.c: Clarify codeKarl Williamson2014-05-301-3/+1
| | | | | | We output the message when there is a printable ASCII character, so use that as the test instead of complementing the test for a control. This makes the code somewhat clearer.
* "\cX" where X is non-printable is now fatalKarl Williamson2014-05-301-8/+2
| | | | It had been deprecated, scheduled to be removed in 5.22.
* Make a literal "{" fatal after \b and \B in regexesKarl Williamson2014-02-051-0/+2
| | | | These have been deprecated since v5.14.
* dquote_static.c: White-space onlyKarl Williamson2014-02-051-12/+12
| | | | Outdent code whose surrounding block was removed by the previous commit
* Forbid "\c{" and \c{non-ascii}Karl Williamson2014-02-051-18/+16
| | | | | These constructs have been deprecated since v5.14 with the intention of making them fatal in 5.18. This wasn't done; and is being done now.
* Deprecate certain rare uses of backslashes within regexesKarl Williamson2013-01-191-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are three pairs of characters that Perl recognizes as metacharacters in regular expression patterns: {}, [], and (). These can be used as well to delimit patterns, as in: m{foo} s(foo)(bar) Since they are metacharacters, they have special meaning to regular expression patterns, and it turns out that you can't turn off that special meaning by the normal means of preceding them with a backslash, if you use them, paired, within a pattern delimitted by them. For example, in m{foo\{1,3\}} the backslashes do not change the behavior, and this matches "f", "o" followed by one to three more occurrences of "o". Usages like this, where they are interpreted as metacharacters, are exceedingly rare; we think there are none, for example, in all of CPAN. Hence, this deprecation should affect very little code. It does give notice, however, that any such code needs to change, which will in turn allow us to change the behavior in future Perl versions so that the backslashes do have an effect, and without fear that we are silently breaking any existing code. =head1 Performance Enhancements
* Add warnings for "\08", /\017/Karl Williamson2013-01-141-0/+29
| | | | | | | | | | | | | This was discussed in thread http://perl.markmail.org/thread/avtzvtpzemvg2ki2 but I never got around to this portion of the consensus, until now. I did a cpan grep http://grep.cpan.me/?q=%28^|[^\\]%29\\[0-7]{1%2C2}[8-9]&page=1 and eyeballing the results, saw three cases where this warning might show up; one of which was for EBCDIC. The others looked to be false positives, such as in .css files.
* grok_bslash_[ox]: Add param to silence non-portable warningsKarl Williamson2013-01-111-0/+11
| | | | | | | | If a hex or octal number is too big to fit in a 32 bit word, grok_oct and grok_hex by default output a warning that it is a non-portable value. This new parameter to the grok_bslash functions can cause them to shut up those warnings. This is currently unused, but will be needed in future commits.
* dquote_static.c: refactor common code to initializationKarl Williamson2013-01-111-3/+4
| | | | | This flag bit is set in both branches of the code; it might as well be initialized instead.
* dquote_static.c: White-space only; no code changesKarl Williamson2013-01-111-6/+6
| | | | This properly indents a newly-formed block
* Add optional strict mode to grok_bslash_[xo]Karl Williamson2013-01-111-7/+57
| | | | | | This mode croaks on any iffy constructs that currently compile. It is not currently used; documentation of the error messages will be delivered later.
* Better error pos for grok_bslash_[xo]Karl Williamson2013-01-111-0/+6
| | | | | | | | | These functions advance the parse pointer for the caller. The regex code has the infrastructure to output a marker as to where the error was. This commit simply moves the parse pointer past all the legal digits in the input, which are likely supposed to be part of the number, which makes it likely that the missing right brace point is just past those.
* Revise calling sequences for grok_bslash_[xo]Karl Williamson2013-01-111-55/+53
| | | | | | By passing the address of the parse pointer, the functions can advance it, eliminating a parameter to the function, and simplifying the code in the caller.
* Change core calls of isALNUM() to isWORDCHAR()Karl Williamson2012-12-311-1/+1
| | | | The latter is more clearly named to indicate it includes the underscore.
* silence some clang warningsDavid Mitchell2012-12-041-1/+0
| | | | | | | | principally, proto.h was sometimes being included twice - once before a fn decl, and once after - giving rise to a 'decl after def' warning. Also, S_croak_memory_wrap was declared static in every source file, but not used in some. So selectively disable the unused-function warning.
* Remove "register" declarationsKarl Williamson2012-11-241-1/+1
| | | | | | | This finishes the removal of register declarations started by eb578fdb5569b91c28466a4d1939e381ff6ceaf4. It neglected the ones in function parameter declarations, and didn't include things in dist, ext, and lib, which this does include
* clean up compilation warningsJesse Luehrs2012-06-271-0/+1
|
* dquote_static.c: Clarify commentKarl Williamson2012-06-201-1/+1
|
* Refactor \x processing to single functionKarl Williamson2012-06-201-0/+67
| | | | | | | | | | There are three places that process \x. These can and did get out of sync. This moves all three to use a common static inline function so that they all do the same thing on the same inputs, and their behaviors will not drift apart again. This commit should not change current behavior. A previous commit was designed to bring all three to identical behavior.
* grok_bslash_o: Don't convert from nativeKarl Williamson2012-06-201-1/+1
| | | | | | | This was and is a no-op on ASCII platforms, but on EBCDIC, when you did e.g., a \o{7}, it would convert that to a 127. But it did not do this on a \007, giving inconsistent results. Now, \o{7} yields 7, and thus is consistent, and matches the documentation.
* update the editor hints for spaces, not tabsRicardo Signes2012-05-291-2/+2
| | | | | This updates the editor hints in our files for Emacs and vim to request that tabs be inserted as spaces.
* Fix up \cX for 5.14Karl Williamson2011-02-091-10/+18
| | | | | | | | | | | | | | | | | | | | | | | 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.
* dquote_static.c: Add commentKarl Williamson2011-02-091-1/+1
|
* Move grok_bslash_c to dquote.c and make staticKarl Williamson2011-02-091-0/+41
| | | | No other changes were made
* Move grok_blsash_o and make staticKarl Williamson2011-02-091-0/+80
| | | | | | 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
* S_regcurly needs thread context.Craig A. Berry2011-01-291-1/+1
| | | | | | | Actually I can't see any reason it actually *needs* thread context, but 881ffab65cdbee2f146ada660e5593bad2e71472 added thread context to the prototype without adding it to the function definition, thus breaking builds with -Dusethreads.
* Use embed.pl inline capabilities for regcurlyKarl Williamson2011-01-291-12/+6
| | | | Change the regcurly definition to use the new inline abilities.
* Small efficiency nit for regcurly()Karl Williamson2010-10-031-3/+4
| | | | As previously written, a test was executed unnecessarily
* Extract regcurly as a static inline function.Andy Dougherty2010-09-221-0/+51
This patch extracts regcurly from regcomp.c and converts it to a static inline function in a new file dquote_static.c that is now #included by regcomp.c and toke.c. This change will require 'make regen'.