]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
Restore \Q..\E support in character classes
authorJustin Viiret <justin.viiret@intel.com>
Thu, 12 Nov 2015 02:27:55 +0000 (13:27 +1100)
committerMatthew Barr <matthew.barr@intel.com>
Wed, 18 Nov 2015 04:27:05 +0000 (15:27 +1100)
src/parser/Parser.rl
unit/hyperscan/bad_patterns.txt

index 966568753ebddb022f4a8af5d5ea8dd7a119e89c..65cd7c1a3392898e80529b8150e781a3658381a5 100644 (file)
@@ -893,11 +893,7 @@ unichar readUtf8CodePoint4c(const u8 *ts) {
                   throw LocatedParseError("Invalid POSIX named class");
               };
               '\\Q' => {
-                  // fcall readQuotedClass;
-                  ostringstream str;
-                  str << "\\Q..\\E sequences in character classes not supported at index "
-                      << ts - ptr << ".";
-                  throw ParseError(str.str());
+                  fcall readQuotedClass;
               };
               '\\E' => { /*noop*/};
               # Backspace (this is only valid for \b in char classes)
@@ -1131,10 +1127,7 @@ unichar readUtf8CodePoint4c(const u8 *ts) {
             inCharClassEarly = false;
         };
         # if we hit a quote before anything "real", handle it
-        #'\\Q' => { fcall readQuotedClass; };
-        '\\Q' => {
-            throw LocatedParseError("\\Q..\\E sequences in character classes not supported");
-        };
+        '\\Q' => { fcall readQuotedClass; };
         '\\E' => { /*noop*/};
 
         # time for the real work to happen
@@ -1170,6 +1163,7 @@ unichar readUtf8CodePoint4c(const u8 *ts) {
               # Literal character
               any => {
                   currentCls->add(*ts);
+                  inCharClassEarly = false;
               };
             *|;
 
index 3b13e06479418f8664867678705f38a8275a9720..fb2a2357ac4c5e1d39f5256874fe4b024ac5c789 100644 (file)
@@ -85,7 +85,6 @@
 84:/[=\]=]/ #Unsupported POSIX collating element at index 0.
 85:/A(?!)+Z/ #Invalid repeat at index 5.
 86:/\X/ #\X unsupported at index 0.
-87:/[a\Qz\E]/ #\Q..\E sequences in character classes not supported at index 2.
 88:/[A-\d]/ #Invalid range in character class at index 3.
 89:/[A-[:digit:]]/ #Invalid range in character class at index 3.
 90:/B[--[:digit:]--]+/ #Invalid range in character class at index 4.