Revision: 848
http://vcs.pcre.org/viewvc?view=rev&revision=848
Author: ph10
Date: 2012-01-04 16:34:01 +0000 (Wed, 04 Jan 2012)
Log Message:
-----------
Tidy compile-time error messages for 16-bit.
Modified Paths:
--------------
code/trunk/pcre_compile.c
code/trunk/pcre_internal.h
code/trunk/pcreposix.c
code/trunk/testdata/testinput18
code/trunk/testdata/testoutput18
code/trunk/testdata/testoutput2
code/trunk/testdata/testoutput5
Modified: code/trunk/pcre_compile.c
===================================================================
--- code/trunk/pcre_compile.c 2012-01-03 17:49:03 UTC (rev 847)
+++ code/trunk/pcre_compile.c 2012-01-04 16:34:01 UTC (rev 848)
@@ -438,7 +438,7 @@
/* 30 */
"unknown POSIX class name\0"
"POSIX collating elements are not supported\0"
- "this version of PCRE is not compiled with PCRE_UTF8 support\0"
+ "this version of PCRE is compiled without UTF support\0"
"spare error\0" /** DEAD **/
"character value in \\x{...} sequence is too large\0"
/* 35 */
@@ -461,7 +461,7 @@
"too many named subpatterns (maximum " XSTRING(MAX_NAME_COUNT) ")\0"
/* 50 */
"repeated subpattern is too long\0" /** DEAD **/
- "octal value is greater than \\377 (not in UTF-8 mode)\0"
+ "octal value is greater than \\377 in 8-bit non-UTF-8 mode\0"
"internal error: overran compiling workspace\0"
"internal error: previously-checked referenced subpattern not found\0"
"DEFINE group contains more than one branch\0"
@@ -480,14 +480,15 @@
/* 65 */
"different names for subpatterns of the same number are not allowed\0"
"(*MARK) must have an argument\0"
- "this version of PCRE is not compiled with PCRE_UCP support\0"
+ "this version of PCRE is not compiled with Unicode property support\0"
"\\c must be followed by an ASCII character\0"
"\\k is not followed by a braced, angle-bracketed, or quoted name\0"
/* 70 */
"internal error: unknown opcode in find_fixedlength()\0"
"\\N is not supported in a class\0"
"too many forward references\0"
- "disallowed UTF-8/16 code point (>= 0xd800 && <= 0xdfff)\0"
+ "disallowed Unicode code point (>= 0xd800 && <= 0xdfff)\0"
+ "invalid UTF-16 string\0"
;
/* Table to identify digits and hex digits. This is used when compiling
@@ -7706,7 +7707,11 @@
if (utf && (options & PCRE_NO_UTF8_CHECK) == 0 &&
(errorcode = PRIV(valid_utf)((PCRE_PUCHAR)pattern, -1, erroroffset)) != 0)
{
+#ifdef COMPILE_PCRE8
errorcode = ERR44;
+#else
+ errorcode = ERR74;
+#endif
goto PCRE_EARLY_ERROR_RETURN2;
}
#else
Modified: code/trunk/pcre_internal.h
===================================================================
--- code/trunk/pcre_internal.h 2012-01-03 17:49:03 UTC (rev 847)
+++ code/trunk/pcre_internal.h 2012-01-04 16:34:01 UTC (rev 848)
@@ -1939,7 +1939,7 @@
ERR40, ERR41, ERR42, ERR43, ERR44, ERR45, ERR46, ERR47, ERR48, ERR49,
ERR50, ERR51, ERR52, ERR53, ERR54, ERR55, ERR56, ERR57, ERR58, ERR59,
ERR60, ERR61, ERR62, ERR63, ERR64, ERR65, ERR66, ERR67, ERR68, ERR69,
- ERR70, ERR71, ERR72, ERR73, ERRCOUNT };
+ ERR70, ERR71, ERR72, ERR73, ERR74, ERRCOUNT };
/* The real format of the start of the pcre block; the index of names and the
code vector run on as long as necessary after the end. We store an explicit
Modified: code/trunk/pcreposix.c
===================================================================
--- code/trunk/pcreposix.c 2012-01-03 17:49:03 UTC (rev 847)
+++ code/trunk/pcreposix.c 2012-01-04 16:34:01 UTC (rev 848)
@@ -158,6 +158,7 @@
REG_BADPAT, /* \N is not supported in a class */
REG_BADPAT, /* too many forward references */
REG_BADPAT, /* disallowed UTF-8/16 code point (>= 0xd800 && <= 0xdfff) */
+ REG_BADPAT /* invalid UTF-16 string (should not occur) */
};
/* Table of texts corresponding to POSIX error codes */
Modified: code/trunk/testdata/testinput18
===================================================================
--- code/trunk/testdata/testinput18 2012-01-03 17:49:03 UTC (rev 847)
+++ code/trunk/testdata/testinput18 2012-01-04 16:34:01 UTC (rev 848)
@@ -244,4 +244,6 @@
<!testsaved16BE-2
+/\x{DF00}/8
+
/-- End of testinput18 --/
Modified: code/trunk/testdata/testoutput18
===================================================================
--- code/trunk/testdata/testoutput18 2012-01-03 17:49:03 UTC (rev 847)
+++ code/trunk/testdata/testoutput18 2012-01-04 16:34:01 UTC (rev 848)
@@ -899,4 +899,7 @@
Subject length lower bound = 2
No set of starting bytes
+/\x{DF00}/8
+Failed: invalid UTF-16 string at offset 0
+
/-- End of testinput18 --/
Modified: code/trunk/testdata/testoutput2
===================================================================
--- code/trunk/testdata/testoutput2 2012-01-03 17:49:03 UTC (rev 847)
+++ code/trunk/testdata/testoutput2 2012-01-04 16:34:01 UTC (rev 848)
@@ -6366,7 +6366,7 @@
10: Y
/\777/I
-Failed: octal value is greater than \377 (not in UTF-8 mode) at offset 3
+Failed: octal value is greater than \377 in 8-bit non-UTF-8 mode at offset 3
/\s*,\s*/IS
Capturing subpattern count = 0
Modified: code/trunk/testdata/testoutput5
===================================================================
--- code/trunk/testdata/testoutput5 2012-01-03 17:49:03 UTC (rev 847)
+++ code/trunk/testdata/testoutput5 2012-01-04 16:34:01 UTC (rev 848)
@@ -12,10 +12,10 @@
Failed: character value in \x{...} sequence is too large at offset 12
/\x{d800}/8
-Failed: disallowed UTF-8/16 code point (>= 0xd800 && <= 0xdfff) at offset 7
+Failed: disallowed Unicode code point (>= 0xd800 && <= 0xdfff) at offset 7
/\x{dfff}/8
-Failed: disallowed UTF-8/16 code point (>= 0xd800 && <= 0xdfff) at offset 7
+Failed: disallowed Unicode code point (>= 0xd800 && <= 0xdfff) at offset 7
/\x{d7ff}/8
@@ -483,7 +483,7 @@
No need char
/\777/I
-Failed: octal value is greater than \377 (not in UTF-8 mode) at offset 3
+Failed: octal value is greater than \377 in 8-bit non-UTF-8 mode at offset 3
/\x{100}*\d/8DZ
------------------------------------------------------------------
@@ -1563,10 +1563,10 @@
/\x{d7ff}\x{e000}/8
/\x{d800}/8
-Failed: disallowed UTF-8/16 code point (>= 0xd800 && <= 0xdfff) at offset 7
+Failed: disallowed Unicode code point (>= 0xd800 && <= 0xdfff) at offset 7
/\x{dfff}/8
-Failed: disallowed UTF-8/16 code point (>= 0xd800 && <= 0xdfff) at offset 7
+Failed: disallowed Unicode code point (>= 0xd800 && <= 0xdfff) at offset 7
/\h+/8
\x{1681}\x{200b}\x{1680}\x{2000}\x{202f}\x{3000}