| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
For the node types that have differing versions depending on the
character set regex modifiers, /d, /l, /u, /a, and /aa, we can use the
enum values as offsets from the base node number to derive the correct
one. This eliminates a number of tests.
Because there is no DIGITU node type, I added placeholders for it (and
NDIGITU) to avoid some special casing of it (more important in future
commits). We currently have many available node types, so can afford to
waste these two.
|
|
|
|
|
|
| |
This causes all the nodes that depend on the regex modifier, BOUND,
BOUNDL, etc. to have the same relative ordering. This will enable a
future commit to simplify generation of the correct node.
|
|
|
|
|
| |
As a result of commit fab2782b37b5570d7f8f8065fd7d18621117ed49
the description is no longer valid. This node type is trieable.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This cleans up and simplifies and extends how the trie
logic interacts with the new node types. This change ultimately
makes the EXACTFU, EXACTFU_SS, EXACTFU_NO_TRIE (renamed to
EXACTFU_TRICKYFOLD) work properly with the trie engine regardless
of whether the string is utf8 or latin1.
This patch depends on the following:
EXACT => utf8 or "binary" text
EXACTFU => either pre-folded utf8, or latin1 that has to be folded as though it was utf8
EXACTFU_SS => special case of EXACTFU to handle \xDF/ss (affects latin1 treatment)
EXACTFU_TRICKYFOLD => special case of EXACTFU to handle tricky non-latin1 fold rules
EXACTF => "old style fold logic" untriable nodetype
EXACTFA => (currently) untriable nodetype
EXACTFL => (currently) untriable nodetype
See the comments in regcomp.sym for these fold types.
This patch involves a number of distinct, but related parts. Starting
from compilation:
* Simplify how we detect a triable sequence given the new nodetypes,
this also probably fixed some "bugs" in how we detected certain
sequences, like /||foo|bar/.
* Simplify how we read EXACTFU nodes under utf8 by removing the now
redundant folding logic (EXACTFU nodes under utf8 are prefolded).
Also extend this logic to handle latin1 patterns properly (in
conjunction with other changes)
* Part of the problems associated with EXACTFU_SS and EXACTFU_TRICKYFOLD
have to do with how the trie logic interacts with the minlen logic.
This change handles both by pessimising the minlen when encounting
these nodetypes. One observation is that the minlen logic is basically
broken, and works only because it conflates bytes and codepoints in
such a way that we more or less always get a value small enough that things work out
anyway. Fixing that is properly is the job of another patch.
* Part of the problem of doing folding under unicode rules is that
there are a lot of foldings possible, some with strange rules. This
means that the bitmap logic does not work correctly in all cases,
as we currently do not have any way to populate it properly.
So this patch disables the bitmap entirely when folding is involved
until that is fixed.
The end result of this is: we can TRIE/AHOCORASICK any sequence of
EXACT, or EXACTFU (ish) nodes, regardless of utf8 or not, but we disable
the bitmap when folding.
A note for follow up relating to this patch is that the way EXACTFU_XXX
nodes are currently dealt with we wont build the "maximal" trie because
of their presence, instead creating a "jumptrie" consisting of either a
leading EXACTFU node followed by a EXACTFU_XXX node, or vice versa. We
should eventually address that.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This node type hasn't been used since 5.14.0. Instead an ANYOFV node
was generated where formerly a FOLDCHAR node would have been used. The
ANYOFV was used because it already existed and was up-to-date, whereas
FOLDCHAR would have needed some bug fixes to adapt it, even though it
would be faster in execution than ANYOFV; so the code for it was
retained in case it was needed.
However, both these solutions were defective, and a previous commit has
changed things to a different type of solution entirely. Thus FOLDCHAR
is obsolescent and can be removed, though the code in it was used as a
base for some of the new solutions.
|
|
|
|
|
|
| |
This new node is like EXACTFU but is not currently trie'able. This adds
handling for it in regexec.c, but it is not currently generated; this
commit is preparing for future commits
|
|
|
|
|
|
|
|
|
|
| |
This node will be used to distinguish between the case in a non-UTF8
pattern and string where something could be matched that is of different
lengths. The only instance where this can happen is the LATIN SMALL
LETTER SHARP S can match the sequences "ss", "Ss", "sS", or "SS", hence
the name.
This node is not currently generated; this prepares for future commits
|
| |
|
| |
|
|
|
|
| |
These are not used yet.
|
|
|
|
| |
It is not used yet.
|
|
|
|
|
| |
This changes the bits to add a new charset type for /aa, and other bookkeeping
for it.
|
|
|
|
|
|
|
|
|
| |
Previously all the scripts in regen/ had code to generate header comments
(buffer-read-only, "do not edit this file", and optionally regeneration
script, regeneration data, copyright years and filename).
This change results in some minor reformatting of header blocks, and
standardises the copyright line as "Larry Wall and others".
|
|
|
|
| |
These aren't used yet.
|
|
|
|
|
|
| |
These are unused because there is no difference between Unicode
semantics and non for digits. That is there are no digit characters in
the 128-255 range.
|
|
|
|
|
|
| |
This will make for somewhat more efficient execution, as won't have to
test the regnode type multiple times, at the expense of slightly bigger
code space.
|
|
|
|
|
| |
These nodes aren't actually used yet, but allow the splitting out of
Unicode semantics for \w, \s, and complements
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The /d, /l, and /u regex modifiers are mutually exclusive. This patch
changes the field that stores the character set to use more than one bit
with an enum determining which one. This data structure more
closely follows the semantics of their being mutually exclusive, and
conserves bits as well, and is better expandable.
A small API is added to set and query the bit field.
This patch is not .xs source backwards compatible. A handful of cpan
programs are affected.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This node is like a straight ANYOF node to match [bracketed character classes],
but can match multiple characters; in particular it can match a multi-char
fold.
When multi-char Unicode folding was added to Perl, it was overlooked that the
ANYOF node is supposed to match exactly one character, hence there have been
bugs ever since. Adding a specialized node that can match multiple chars,
these can be fixed more easily. I tried at first to make ANYOF match multiple
chars, but this causes Perl to not be able to fully compile.
|
| |
|
|
|
|
|
| |
These were missing that they were simple (matching exactly 1 character)
and have 0 regnode arguments
|
|
|
|
|
|
| |
The recently added regnodes are moved to their respective equivalence
classes, and the named backreferences are moved to just after the
numbered backreferences
|
|
|
|
|
|
|
| |
These will be used for matching capture buffers case-insensitively using
Unicode semantics.
make regen will regenerate the delivered regnodes.h
|
|
|
|
|
| |
This node will be used for matching case insensitive exactish nodes
using Unicode semantics
|
|
|
|
| |
make regen needed
|
|
|
|
| |
requires regen
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds recognition of these modifiers, with appropriate action
for d and l. u does nothing useful yet. This allows for the
interpolation of a regex into another one without losing the character
set semantics that it was compiled with, as for the first time, the
semantics is now specified in the stringification as one of these
modifiers.
To this end, it allocates an unused bit in the structures. The off-
sets change so as to not disturb other bits.
|
|
|
|
|
|
|
|
|
|
|
|
| |
make regen needed.
This commit moves some bits in extflags around so that all the unallocated
ones are at the boundary between the unshared portion and the portion
shared with op.h. This allows them to be allocated in the future to go
either way, without affecting binary compatibility at that time.
The high-order bits are unaffected, but the low order ones move to fill
the gap.
|
|
|
|
|
|
|
| |
This is O(1) with no branching, instead of O(n) with branching.
Deprecate the old implementation's externally visible variables
PL_simple and PL_varies. Google codesearch suggests that nothing outside the
core regexp code was using these.
|
|
|
|
| |
This allows the implementation of the lookup mechanism to change.
|
|
|
|
|
|
| |
Add a new flags column to regcomp.sym, with V if the node type is in PL_varies,
S if it is in PL_simple, and . if a placeholder is needed because subsequent
optional columns are present.
|
|
|
|
|
|
|
| |
As VERB is "Used only for the type field of verbs" this is only a cosmetic
change, causing that correct description to appear in the comment in
regnodes.h. The change to regarglen doesn't affect anything, as the VERB type
is never actually used for compiled nodes.
|
|
|
| |
p4raw-id: //depot/perl@32852
|
|
|
|
|
|
|
| |
lowest 4 bits (which saves a shift), and the "flags indicating special
patterns" into contiguous bits. This makes everything a little tidier,
and saves 88 bytes (woohoo!) of object file with -Os on x86 FreeBSD.
p4raw-id: //depot/perl@32775
|
|
|
|
|
|
|
|
|
|
| |
ensure proper scope cleanup.
Fix and test for issue raised in:
Subject: Very strange interaction between regex and lexical array in blead
Message-ID: <20070818015537.0088db31@r2d2>
p4raw-id: //depot/perl@31733
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Date: Fri, 29 Jun 2007 23:38:07 +0200
Message-ID: <20070629213807.GA14454@abigail.nl>
Subject: [PATCH pod/perlre.pod] Keeping up with the changes.
From: Abigail <abigail@abigail.be>
Date: Sat, 30 Jun 2007 01:24:36 +0200
Message-ID: <20070629232436.GA15326@abigail.nl>
Plus tweaks, and debug enahancements.
p4raw-id: //depot/perl@31506
|
|
|
|
|
|
|
| |
regex engine.
Message-ID: <9b18b3110704240746u461e4bdcl208ef7d7f9c5ef64@mail.gmail.com>
p4raw-id: //depot/perl@31081
|
|
|
|
|
|
|
| |
PCRE and unicode tr18
Message-ID: <9b18b3110704221434g43457742p28cab00289f83639@mail.gmail.com>
p4raw-id: //depot/perl@31026
|
|
|
|
|
| |
Message-ID: <460EB6C1.4020406@iki.fi>
p4raw-id: //depot/perl@30824
|
|
|
|
|
|
|
| |
-DDEBUGGING, it's going to need PL_reg_name even if core perl doesn't.
So something is always going to use it, so always define it, and always
export it. (But only define it once, so that static builds work.)
p4raw-id: //depot/perl@30464
|
|
|
|
|
|
|
| |
This allows re to be a static extension.
As it's now no-longer a static variable in regcomp.c, it needs a PL_
prefix.
p4raw-id: //depot/perl@30451
|
|
|
|
|
|
|
|
|
| |
cleanup and more docs for regatom()
Message-ID: <9b18b3110701101133i46dc5fd0p1476a0f1dd1e9c5a@mail.gmail.com>
(plus POD nits by Merijn and myself)
p4raw-id: //depot/perl@29756
|
|
|
|
|
| |
Message-ID: <9b18b3110611090809l667860c9t6c27453d7c86a21e@mail.gmail.com>
p4raw-id: //depot/perl@29260
|
|
|
|
|
|
|
|
| |
Message-ID: <9b18b3110611060406u2fa1572as57073949a5df9e62@mail.gmail.com>
Plus a portability fix (in string comparison for regex verbs)
and doc tweaks / podchecker fixes
p4raw-id: //depot/perl@29222
|
|
|
|
|
| |
Message-ID: <9b18b3110611020335h7ea469a8g28ca483f6832816d@mail.gmail.com>
p4raw-id: //depot/perl@29189
|
|
|
|
|
| |
Message-ID: <9b18b3110610311349n5947cc8fsf0b2e6ddd9a7ee01@mail.gmail.com>
p4raw-id: //depot/perl@29183
|
|
|
|
|
|
| |
Subject: [PATCH] regex engine optimiser should grok subroutine patterns, and, name subroutine regops more intuitively
Message-ID: <9b18b3110610300915x3abf6cddu9c2071a70bea48e1@mail.gmail.com>
p4raw-id: //depot/perl@29162
|
|
|
|
|
|
| |
Subject: [PATCH] regex engine optimiser should grok subroutine patterns, and, name subroutine regops more intuitively
Message-ID: <9b18b3110610300915x3abf6cddu9c2071a70bea48e1@mail.gmail.com>
p4raw-id: //depot/perl@29161
|