summaryrefslogtreecommitdiff
path: root/dquote_static.c
Commit message (Collapse)AuthorAgeFilesLines
* 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'.