mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
parser: ignore \E that is not preceded by \Q
This conforms to PCRE's behaviour, where an isolated \E that is not preceded by \Q is ignored.
This commit is contained in:
parent
c58d9d04a1
commit
67e450115a
@ -1226,9 +1226,8 @@ unichar readUtf8CodePoint4c(const u8 *ts) {
|
|||||||
'\\Q' => {
|
'\\Q' => {
|
||||||
fgoto readQuotedLiteral;
|
fgoto readQuotedLiteral;
|
||||||
};
|
};
|
||||||
'\\E' => {
|
# An \E that is not preceded by a \Q is ignored
|
||||||
throw LocatedParseError("Unmatched \\E");
|
'\\E' => { /* noop */ };
|
||||||
};
|
|
||||||
# Match any character
|
# Match any character
|
||||||
'\.' => {
|
'\.' => {
|
||||||
currentSeq->addComponent(generateComponent(CLASS_ANY, false, mode));
|
currentSeq->addComponent(generateComponent(CLASS_ANY, false, mode));
|
||||||
|
@ -32,7 +32,6 @@
|
|||||||
31:/\B/W #\B unsupported in UCP mode at index 0.
|
31:/\B/W #\B unsupported in UCP mode at index 0.
|
||||||
32:/foo(?{print "Hello world\n";})bar/ #Embedded code is not supported at index 3.
|
32:/foo(?{print "Hello world\n";})bar/ #Embedded code is not supported at index 3.
|
||||||
33:/the (\S+)(?{ $color = $^N }) (\S+)(?{ $animal = $^N })/i #Embedded code is not supported at index 9.
|
33:/the (\S+)(?{ $color = $^N }) (\S+)(?{ $animal = $^N })/i #Embedded code is not supported at index 9.
|
||||||
34:/foobar\E/s #Unmatched \E at index 6.
|
|
||||||
35:/\X/8 #\X unsupported at index 0.
|
35:/\X/8 #\X unsupported at index 0.
|
||||||
36:/\B+/ #Invalid repeat at index 2.
|
36:/\B+/ #Invalid repeat at index 2.
|
||||||
37:/\B?/ #Invalid repeat at index 2.
|
37:/\B?/ #Invalid repeat at index 2.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user