summaryrefslogtreecommitdiff
path: root/regcomp.c
Commit message (Collapse)AuthorAgeFilesLines
* create new unicode props as defined in POSIX spec (optionally use them in ↵Yves Orton2008-11-071-12/+34
| | | | | | | | | | | | | | | | | | | | the regex engine) Perlbug #60156 and #49302 (and probably others) resolve down to the problem that the definition of \s and \w and \d and the POSIX charclasses are different for unicode strings and for non-unicode strings. This broke the character class logic in the regex engine. The easiest fix to make the character class logic sane again is to define new properties which do match. This change creates new property classes that can be used instead of the traditional ones (it does not change the previously defined ones). If the define in regcomp.h: #define PERL_LEGACY_UNICODE_CHARCLASS_MAPPINGS 1 is changed to 0, then the new mappings will be used. This will fix a bunch of bugs that are reported as TODO items in the new reg_posixcc.t test file. p4raw-id: //depot/perl@34769
* Make sure inversion sign is shown in all anyof classes that we show in regpropYves Orton2008-11-071-10/+19
| | | | | And refactor the code that adds the extra braces into a macro, and make it support the colorization stuff. p4raw-id: //depot/perl@34766
* Various changes to regex diagnostics and testingYves Orton2008-11-061-5/+18
| | | | | | | | | | | * Make ANYOF output from regprop easier to read by adding ][ in between the unicode representation and the "ascii" one * Make it possible to make tests in re_tests todo. * add a todo test for a complementary character class match that should fail (perl #60156) * Also add a comment explaining a previous commit (relating to perl #60344) p4raw-id: //depot/perl@34755
* Reolve perlbug #59328: In re's, \N{U+...} doesn't match for ... > 256karl williamson2008-11-061-6/+16
| | | | | | | Subject: PATCH [perl #59328] In re's, \N{U+...} doesn't match for ... > 256 Message-ID: <49124B78.2000907@khwilliamson.com> Date: Wed, 05 Nov 2008 18:42:16 -0700 p4raw-id: //depot/perl@34747
* PATCH: Large omnibus patch to clean up the JRRT quotesTom Christiansen2008-11-021-1/+3
| | | | | | Message-ID: <25940.1225611819@chthon> Date: Sun, 02 Nov 2008 01:43:39 -0600 p4raw-id: //depot/perl@34698
* [perl #56526] m/a{1,0}/ compiles but doesn't match a literal string Michael Cartmell2008-11-021-1/+1
| | | | | | From: Michael Cartmell (via RT) <perlbug-followup@perl.org> Message-ID: <rt-3.6.HEAD-27577-1215001078-1211.56526-75-0@perl.org> p4raw-id: //depot/perl@34697
* Explicitly specify some printf formats for constant strings.Rafael Garcia-Suarez2008-11-021-3/+3
| | | | | | This is mostly to silence gcc's warning, "format not a string literal and no format arguments". p4raw-id: //depot/perl@34694
* Eliminate (SV *) casts from the rest of *.c, picking up one (further)Nicholas Clark2008-10-301-14/+14
| | | | | erroneous const in dump.c. p4raw-id: //depot/perl@34675
* SvPV() does not take a const SV*, which means that the pattern argumentNicholas Clark2008-10-301-3/+3
| | | | | | | | | | to Perl_re_compile() can't be const, which means that the pattern argument to Perl_pregcomp() can't be const, as can't the argument in the function in the regexp engine structure. It's a shame that no-one spotted this earlier. (Again) I may have rendered the documentation inaccurate. p4raw-id: //depot/perl@34672
* Use pvs macros instead of pvn where possible.Marcus Holland-Moritz2008-10-291-2/+2
| | | p4raw-id: //depot/perl@34653
* Eliminate (AV *) casts in *.c.Nicholas Clark2008-10-291-6/+6
| | | p4raw-id: //depot/perl@34650
* Every remaining (HV *) cast in *.cNicholas Clark2008-10-281-2/+2
| | | p4raw-id: //depot/perl@34629
* ss_dup wrapper const casting analagous to change 34626.Nicholas Clark2008-10-281-2/+2
| | | p4raw-id: //depot/perl@34628
* Update copyright years.Nicholas Clark2008-10-251-1/+2
| | | p4raw-id: //depot/perl@34585
* Fix memory leak in // caused by single-char character classMarcus Holland-Moritz2008-10-181-0/+3
| | | | | | optimization. This was most probably introduced with #28262. This change fixes perl #59516. p4raw-id: //depot/perl@34507
* Avoid allocating 1 extra regnode when duplicating a regexp.Nicholas Clark2008-10-051-1/+1
| | | | | | See http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-09/msg00590.html and http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-10/msg00163.html p4raw-id: //depot/perl@34464
* Two missing 'static's, spotted by Merijn's smoker.Nicholas Clark2008-09-201-1/+1
| | | p4raw-id: //depot/perl@34381
* Welcome to refcount hell. Fix the leaks reported by #57024Marcus Holland-Moritz2008-07-181-5/+4
| | | | | along with a bunch other named capture related leaks. p4raw-id: //depot/perl@34151
* Strength reduction optimisation seems to spot that a = a + 1; is justNicholas Clark2008-06-091-5/+1
| | | | | a++; so write it as the former, to keep PERL_DEBUG_COW happy. p4raw-id: //depot/perl@34039
* Re: [PATCH] More COW lvaluesReini Urban2008-06-091-2/+6
| | | | | | Message-ID: <484D491D.9050704@x-ray.at> Date: Mon, 09 Jun 2008 17:15:41 +0200 p4raw-id: //depot/perl@34038
* fix misleading comment about Perl_re_dup_gutsDave Mitchell2008-05-181-2/+2
| | | p4raw-id: //depot/perl@33853
* Re: [perl #52672] regexp failure: (?=) turns into OPFAILÆvar Arnfjörð Bjarmason2008-04-111-0/+2
| | | | | | From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com> Message-ID: <51dd1af80804091738r15d37763lf900d59f8bcc5e81@mail.gmail.com> p4raw-id: //depot/perl@33667
* Silence Borland compiler warnings (except for warnings from zlib) here:Steve Hay2008-02-251-4/+4
| | | | | http://www.nntp.perl.org/group/perl.daily-build.reports/2008/02/msg53937.html p4raw-id: //depot/perl@33370
* Fix bug 50496 -- regcomp.c=~s/lastcloseparen/lastparen/gYves Orton2008-02-171-2/+3
| | | | | | | | | -- lastcloseparen is literally the index of the last paren closed -- lastparen is index of the highest index paren that has been closed. In nested parens, they will be completely different. 'ab'=~/(a(b))/ will have: lastparen = 2, lastcloseparen = 1 'ab'=~/(a)(b)/ will have: lastparen = lastcloseparen = 2 p4raw-id: //depot/perl@33325
* Fix perlbug 50114 and document what the code does a bit betterYves Orton2008-02-171-7/+18
| | | p4raw-id: //depot/perl@33324
* assert() that every NN argument is not NULL. Otherwise we have theNicholas Clark2008-02-121-8/+139
| | | | | | | | | | | | ability to create landmines that will explode under someone in the future when they upgrade their compiler to one with better optimisation. We've already done this at least twice. (Yes, some of the assertions are after code that would already have SEGVd because it already deferences a pointer, but they are put in to make it easier to automate checking that each and every case is covered.) Add a tool, checkARGS_ASSERT.pl, to check that every case is covered. p4raw-id: //depot/perl@33291
* Move the reg_stringify logic to Perl_sv_2pv_flagsÆvar Arnfjörð Bjarmason2008-01-101-40/+0
| | | | | | | | Message-ID: <86zlveaewk.fsf@cpan.org> with two corrections. Plus remove reg_stringify from embed.fnc and regen. p4raw-id: //depot/perl@32934
* seen_eval regex field wasn't getting clonedDave Mitchell2008-01-091-1/+0
| | | p4raw-id: //depot/perl@32933
* Fix the bug introduced by the bug fix of change 30755.Nicholas Clark2008-01-091-1/+9
| | | | | (Certain regexps could SEGV if cloned). p4raw-id: //depot/perl@32932
* Make new regex type be 'REGEXP' and make all core qr//'s be in class Regexp ↵Yves Orton2008-01-061-1/+4
| | | | | (and related changes) p4raw-id: //depot/perl@32880
* Make REGEXP a type distinct from SV. (Much like AV, CV, GV, HV).Nicholas Clark2008-01-051-3/+3
| | | p4raw-id: //depot/perl@32861
* Don't allocate the NV slot for SVt_REGEXP.Nicholas Clark2008-01-051-2/+1
| | | p4raw-id: //depot/perl@32859
* Convert all accesses of the member paren_names of struct regexp toNicholas Clark2008-01-051-18/+18
| | | | | | be accessed via RXp_PAREN_NAMES(). (They are entirely within the regexp implementation). p4raw-id: //depot/perl@32853
* Abolish RXf_UTF8. Store the UTF-8-ness of the pattern with SvUTF8().Nicholas Clark2008-01-051-4/+3
| | | p4raw-id: //depot/perl@32852
* Make Perl_pregcomp() use SvUTF8() of the pattern, rather than the flagNicholas Clark2008-01-051-2/+5
| | | | | bit in pmflags, to decide whether the pattern is UTF-8. p4raw-id: //depot/perl@32851
* Replace all reads of RXf_UTF8 with RX_UTF8().Nicholas Clark2008-01-051-2/+2
| | | p4raw-id: //depot/perl@32849
* Abolish wraplen from struct regexp. We're already storing it in SvCUR.Nicholas Clark2008-01-051-3/+3
| | | p4raw-id: //depot/perl@32845
* Abolish RXp_PRELEN(rx) and RXp_WRAPLEN()Nicholas Clark2008-01-051-9/+9
| | | | | | Fix up some uses of RX_* macros in the block conditionally compiled with STUPID_PATTERN_CHECKS. p4raw-id: //depot/perl@32843
* Abolish wrapped in struct regexp - store the wrapped pattern pointerNicholas Clark2008-01-051-4/+9
| | | | | in the SvPVX(). p4raw-id: //depot/perl@32841
* Add RX_UTF8(), which is effectively SvUTF8() but for regexps.Nicholas Clark2008-01-051-8/+8
| | | | | | | Remove RXp_PRECOMP() and RXp_WRAPPED(). Change the parameter of S_debug_start_match() from regexp to REGEXP. Change its callers [the only part wrong for 5.10.x] p4raw-id: //depot/perl@32840
* Extend newSVpvn_flags() to also call sv_2mortal() if SVs_TEMP is set inNicholas Clark2008-01-031-3/+4
| | | | | | the flags. Move its implementation just ahead of sv_2mortal()'s for CPU cache locality. Refactor all code that can be to use this. p4raw-id: //depot/perl@32818
* Possible future bugs found by the creation of newSVpvn_flags().Nicholas Clark2008-01-031-6/+2
| | | | | But use newSVhek() in preference when possible. p4raw-id: //depot/perl@32813
* Add a new function newSVpvn_flags(), which takes a third parameter ofNicholas Clark2008-01-021-12/+7
| | | | | | | | | | flag bits. Right now the only flag bit is SVf_UTF8, which will call SvUTF8_on() on the new SV for you. Provide a wrapper newSVpvn_utf8(), which takes a boolean, and passes in SVf_UTF8 if that is true. Refactor the core to use it where possible. It makes the source code clearer and smaller, but seems to be swings and roundabouts on object code size. p4raw-id: //depot/perl@32807
* Make struct regexp the body of SVt_REGEXP SVs, REGEXPs become SVs,Nicholas Clark2008-01-021-54/+65
| | | | | | and regexp reference counting is via the regular SV reference counting. This was not as easy at it looks. p4raw-id: //depot/perl@32804
* Convert some "regexp" and "struct regexp" to REGEXP where they areNicholas Clark2008-01-021-5/+5
| | | | | currently equivalent but will be wrong once the equivalence vanishes. p4raw-id: //depot/perl@32803
* Wrap all deferences of struct regexp* in macros RX_*() [and forNicholas Clark2008-01-021-19/+19
| | | | | | | regcomp.c and regexec.c RXp_* where necessary] so that in future we can maintain source compatibility when we add an extra level of dereferencing. p4raw-id: //depot/perl@32802
* The position of the modifier flag bits is actually encoded by a rightNicholas Clark2007-12-291-1/+2
| | | | | | | shift 12 in two places, so replace that magic number with a macro RXf_PMf_STD_PMMOD_SHIFT defined adjacent to the flags it interacts with. p4raw-id: //depot/perl@32774
* Wrap wrapped and wraplen from struct regexp in macros RW_WRAPPED() andNicholas Clark2007-12-291-9/+9
| | | | | | RX_WRAPLEN() to preserve source compatibility when they get moved around. p4raw-id: //depot/perl@32758
* Eliminate prelen from struct regexp. Possibly we are hardcoding a bitNicholas Clark2007-12-281-1/+0
| | | | | | to much, as the replacement assumes that the wrapping string has exactly 1 character after the wrapped string [specifically ')']. p4raw-id: //depot/perl@32757
* Replace 3 uses of RX_PRELEN(r) with plen, which has the same value.Nicholas Clark2007-12-281-3/+3
| | | | | (But isn't a pointer dereference. Or about to become a calculation.) p4raw-id: //depot/perl@32756