summaryrefslogtreecommitdiff
path: root/regcomp.c
Commit message (Collapse)AuthorAgeFilesLines
* Comment-only nitsKarl Williamson2011-10-011-3/+3
|
* regcomp.c: Add invlist_invert_prop()Karl Williamson2011-10-011-0/+38
| | | | | | | | | This new function inverts a Unicode property. A regular inversion doesn't work because it operates on the whole of the code space, and Unicode property inversions don't invert above-Unicode code points. This does for inversion lists, what an earlier commit did for swashes. This function is currently not called by anyone.
* regcomp.c: Add assertionKarl Williamson2011-10-011-0/+2
| | | | | | This is to guard against misuse of the functions. There is no guard currently in the underlying Perl functions to lengthening a string beyond the capacity to hold it.
* avoid defining the same global functions in multiple objectsTony Cook2011-07-241-1/+6
| | | | This caused -Uusedl builds to fail
* fix segv in regcomp.c:S_join_exact()David Mitchell2011-07-051-5/+5
| | | | | | | | | | | This function joins multiple EXACT* nodes into a single node. At the end, under DEBUGGING, it marks the optimised-out nodes as being type OPTIMIZED. However, some of the 'nodes' aren't actually nodes; they're random bits of string at the tail of those nodes. So you can't peek that the 'node's OP field to decide what type it was. Instead, just unconditionally overwrite all the slots with fake OPTIMIZED nodes.
* Change 4 inversion list functions from S_ to Perl_Karl Williamson2011-07-031-8/+8
| | | | | This is in preparation for them to be called from another file. Note that they are still protected by an #ifdef in embed.fnc.
* Change _invlist_invert() from being in-lineKarl Williamson2011-07-031-1/+1
| | | | | | This is in preparation for it to be called from another file. If for performance reasons it needs to be made inline again, it could then be moved into a header.
* Change names of some inversion list functionsKarl Williamson2011-07-031-15/+15
| | | | | | The names now begin with an underscore to emphasize that they are for internal use only. This is in preparation for making them accessible beyond regcomp.c.
* regcomp.c: White space onlyKarl Williamson2011-07-031-2/+2
|
* regcomp.c: Do some [^abc] inversion at compile timeKarl Williamson2011-07-031-5/+32
| | | | | The new facilities with inversion lists enables us to do some more compile-time inversions.
* Add 3 methods for inversion listsKarl Williamson2011-07-031-1/+77
| | | | This adds inversion, cloning, and set subtraction
* Add inversion list dump routine, #ifdef'd out to prevent compiler warning, ↵Karl Williamson2011-07-031-0/+24
| | | | for use when debugging
* Add an element to inversion list data structureKarl Williamson2011-07-031-18/+153
| | | | | This element is restricted to either 0 or 1. The comments detail how its use enables an inversion list to be efficiently inverted.
* regcomp.c: Add commentsKarl Williamson2011-07-031-7/+29
|
* regcomp.c: Parenthesize rhs of #defineKarl Williamson2011-07-031-1/+1
|
* regcomp.c: Move a function aroundKarl Williamson2011-07-031-10/+11
| | | | This is so functions that operate on the same data are adjacent
* Add length element to inversion listsKarl Williamson2011-07-031-2/+15
| | | | | Future changes will make the length no longer the same as SvCUR, so create an element to hold the correct length
* regcomp.c: Use inversion list iteratorKarl Williamson2011-07-031-41/+6
| | | | This changes to use the iterator when traversing an inversion list.
* Add iterator for inversion listsKarl Williamson2011-07-031-1/+53
|
* Allow a header in inversion lists.Karl Williamson2011-07-031-5/+16
| | | | | | An inversion list is an array of UVs. This allows for other UVs to be added at the beginning for ancillary purposes. This patch does not allocate any space for these, however.
* regcomp.c: Correct commentKarl Williamson2011-07-031-1/+1
|
* regcomp.c: Macroize two expressionsKarl Williamson2011-07-031-5/+9
| | | | This is in preparation for making things more complex in a later commit
* regcomp.c: Rmv no longer called functionKarl Williamson2011-07-031-16/+0
| | | | | | | | | | | | | | This hasn't been used since 626725768b7b17463e9ec7b92e2da37105036252 Author: Nicholas Clark <nick@ccl4.org> Date: Thu May 26 22:29:40 2011 -0600 regcomp.c: Fix memory leak regression here was a remaining memory leak in the new inversion lists data structure under threading. This solves it by changing the implementation to use a SVpPV instead of doing our own memory management. Then the already existing code for handling SVs returns the memory when done.
* regcomp.c: Remove no longer called functionKarl Williamson2011-07-031-10/+0
| | | | | | The invlist_destroy function was misleading, as it has changed to just decrement the reference count, which may or may not lead to immediate destruction
* regcomp.c: Remove invlist_destroy callsKarl Williamson2011-07-031-4/+4
| | | | This is in preparation to removing the function
* regcomp.c: #undef after finishedKarl Williamson2011-07-031-0/+2
| | | | | | regcomp.c has a subsection dealing with the implementation of the inversion list class(-like object). Undef its macros so they can't possibly interfere with the rest of regcomp.c
* regcomp.c: Remove unneeded temporaryKarl Williamson2011-07-031-6/+2
| | | | A previous commit changed things so that this is no longer necessary
* regcomp.c: Revise inversion list APIKarl Williamson2011-07-031-18/+33
| | | | | | | These are static functions so no external effect. Revise the calling sequence of two functions so that they can know enough to free memory if appropriate of the other parameters. This hides from the callers the need for tracking when to free memory.
* regcomp.c: PL_utf8_foldclosures is a HVKarl Williamson2011-07-031-1/+1
| | | | It is not an inversion list, contrary to what this line used to say.
* Change inversion lists to SVsKarl Williamson2011-07-031-33/+32
| | | | | | The inversion list is an opaque object, currently implemented as an SV. Even if it ends up being an HV in the future, Nicholas is of the opinion that it should be presented to the world as an SV*.
* regcomp.c: Add commentKarl Williamson2011-05-311-0/+1
|
* regcomp.c: Fix memory leak regressionNicholas Clark2011-05-261-91/+15
| | | | | | | | There was a remaining memory leak in the new inversion lists data structure under threading. This solves it by changing the implementation to use a SVpPV instead of doing our own memory management. Then the already existing code for handling SVs returns the memory when done.
* regcomp.c: Another leak regressionKarl Williamson2011-05-221-0/+1
|
* regcomp.c: Another memory leak regressionKarl Williamson2011-05-201-0/+1
| | | | The reference count should be decremented upon freeing.
* regcomp.c: Fix bug in inversion list intersectionKarl Williamson2011-05-191-21/+35
| | | | | | | | | This code was derived from published code, which says use at your own risk. And in fact had bugs. I don't believe these show up in 5.14, as I think you have to have a list that has been inverted for this to happen. The comments describe what should have been done.
* regcomp.c: Add new macro for readabilityKarl Williamson2011-05-191-6/+7
| | | | | Adding this macro which is the complement of an existing macro helps understanding what is happening at its point of use
* regcomp.c: Greek multi-char folds fixKarl Williamson2011-05-191-0/+3
| | | | | | GREEK PROSGEGRAMMENI and COMBINING GREEK YPOGEGRAMMENI fold to the the first character of one of the tricky folds, and hence need to be treated as potentially tricky themselves.
* regcomp.c: \x{17f} can match /\xdf/iKarl Williamson2011-05-191-0/+1
|
* regex: Add commentsKarl Williamson2011-05-191-3/+4
|
* regcomp.c: Add two tricky fold casesKarl Williamson2011-05-191-0/+4
| | | | | These two characters fold to lower-case characters that are involved in tricky folds, and hence these can be too.
* regcomp.c: Fix regression memory leakKarl Williamson2011-05-181-1/+3
| | | | | | | | | | | I carelessly added this memory leak which happens in a bracketed character class under /i when there is both a above 255 code point listed plus one of the several below 256 code points that participate in a fold with ones above 256. For 5.16, as the use of the inversion list data structure expands, an automatic method of freeing space will need to be put in place. But this should be sufficient for 5.14.1.
* /iaa doesn't work when the result is trie'dKarl Williamson2011-05-181-7/+4
| | | | | | | It turns out that caseless tries currently only work on UTF-8 EXACTFU nodes. The code attempted to test that by using UNI_SEMANTICS, but that doesn't actually work; what is important is the semantics of the current node.
* In Perl_regdupe_internal() eliminate npar, which is assigned to but never used.Nicholas Clark2011-05-181-2/+1
| | | | It has been unused since 28d8d7f41ab202dd restructured the regexp dup code.
* In S_regpiece(), only declare parse_start if conditional code needs it.Nicholas Clark2011-05-181-0/+6
| | | | | | gcc 4.6.0 warns about variables that are set but never read, and unless RE_TRACK_PATTERN_OFFSETS is defined, parse_start is never read. So avoid declaring or setting it if it's not actually going to be used later.
* regcomp.c: change comment wording, from TomCKarl Williamson2011-05-181-3/+3
|
* regcomp.c: White space onlyKarl Williamson2011-05-031-4/+4
| | | | | A previous commit added an 'if' around this code. This now indents the block properly.
* PATCH: [perl #89750]: Unicode regex negated case-insensitivityKarl Williamson2011-05-031-1/+21
| | | | | | | | | | | | | This patch causes inverted [bracketed] character classes to not handle multi-character folds. The reason is that these can lead to very counter-intuitive results (see bug discussion). In an inverted character class, only single-char folds are now generated. However the fold for \xDF=>ss is hard-coded in, and it was too much trouble sending flags to the sub-sub routine that does this, so another check is done at the point of storing the list of multi-char folds. Since \xDF doesn't have a single char fold, this works.
* regcomp: Improve error message for (?-d:...)Karl Williamson2011-04-121-6/+11
| | | | | As agreed, this improvement is going into 5.14. A customized message is output, instead of a generic one.
* PATCH: [perl #86972]: Tweak error messagesKarl Williamson2011-04-121-3/+3
| | | | | | | An earlier commit in this series changed some error messages. I realized that it did not make sense really to use "/a" for the regex modifier, when the message was for the infix form "(?a:", so this just removes the slash.
* PATCH: partial [perl #86972]: Allow /(?aia)/Karl Williamson2011-04-101-13/+35
| | | | | | This allows a second regex 'a' modifier in the infix form to not have to be contiguous with the first, and improves the message if there are extra modifiers.