Fix EBCDIC 0x41 omission and give error for \p and \P in a class when not
supported.
This commit is contained in:
parent
78ea22d11d
commit
bac822ba58
|
@ -167,6 +167,14 @@ now compatible with the specification in Perl's perlebcdic page.
|
||||||
43. Single character repetition in JIT has been improved. 20-30% speedup
|
43. Single character repetition in JIT has been improved. 20-30% speedup
|
||||||
was achieved on certain patterns.
|
was achieved on certain patterns.
|
||||||
|
|
||||||
|
44. The EBCDIC character 0x41 is a non-breaking space, equivalent to 0xa0 in
|
||||||
|
ASCII/Unicode. This has now been added to the list of characters that are
|
||||||
|
recognized as white space in EBCDIC.
|
||||||
|
|
||||||
|
45. When PCRE2 was compiled without Unicode support, the use of \p and \P gave
|
||||||
|
an error (correctly) when used outside a class, but did not give an error
|
||||||
|
within a class.
|
||||||
|
|
||||||
|
|
||||||
Version 10.10 06-March-2015
|
Version 10.10 06-March-2015
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
|
@ -4397,9 +4397,9 @@ for (;; ptr++)
|
||||||
cb, PRIV(vspace_list));
|
cb, PRIV(vspace_list));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef SUPPORT_UNICODE
|
|
||||||
case ESC_p:
|
case ESC_p:
|
||||||
case ESC_P:
|
case ESC_P:
|
||||||
|
#ifdef SUPPORT_UNICODE
|
||||||
{
|
{
|
||||||
BOOL negated;
|
BOOL negated;
|
||||||
unsigned int ptype = 0, pdata = 0;
|
unsigned int ptype = 0, pdata = 0;
|
||||||
|
@ -4413,6 +4413,9 @@ for (;; ptr++)
|
||||||
class_has_8bitchar--; /* Undo! */
|
class_has_8bitchar--; /* Undo! */
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#else
|
||||||
|
*errorcodeptr = ERR45;
|
||||||
|
goto FAILED;
|
||||||
#endif
|
#endif
|
||||||
/* Unrecognized escapes are faulted. */
|
/* Unrecognized escapes are faulted. */
|
||||||
|
|
||||||
|
|
|
@ -382,7 +382,7 @@ space. However, in many other sources it is listed as a space and has been in
|
||||||
PCRE for a long time. */
|
PCRE for a long time. */
|
||||||
|
|
||||||
#define HSPACE_LIST \
|
#define HSPACE_LIST \
|
||||||
CHAR_HT, CHAR_SPACE, 0xa0, \
|
CHAR_HT, CHAR_SPACE, CHAR_NBSP, \
|
||||||
0x1680, 0x180e, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, \
|
0x1680, 0x180e, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, \
|
||||||
0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202f, 0x205f, 0x3000, \
|
0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202f, 0x205f, 0x3000, \
|
||||||
NOTACHAR
|
NOTACHAR
|
||||||
|
@ -408,7 +408,7 @@ PCRE for a long time. */
|
||||||
#define HSPACE_BYTE_CASES \
|
#define HSPACE_BYTE_CASES \
|
||||||
case CHAR_HT: \
|
case CHAR_HT: \
|
||||||
case CHAR_SPACE: \
|
case CHAR_SPACE: \
|
||||||
case 0xa0 /* NBSP */
|
case CHAR_NBSP
|
||||||
|
|
||||||
#define HSPACE_CASES \
|
#define HSPACE_CASES \
|
||||||
HSPACE_BYTE_CASES: \
|
HSPACE_BYTE_CASES: \
|
||||||
|
@ -435,11 +435,12 @@ PCRE for a long time. */
|
||||||
/* -------------- EBCDIC environments -------------- */
|
/* -------------- EBCDIC environments -------------- */
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#define HSPACE_LIST CHAR_HT, CHAR_SPACE
|
#define HSPACE_LIST CHAR_HT, CHAR_SPACE, CHAR_NBSP
|
||||||
|
|
||||||
#define HSPACE_BYTE_CASES \
|
#define HSPACE_BYTE_CASES \
|
||||||
case CHAR_HT: \
|
case CHAR_HT: \
|
||||||
case CHAR_SPACE
|
case CHAR_SPACE: \
|
||||||
|
case CHAR_NBSP
|
||||||
|
|
||||||
#define HSPACE_CASES HSPACE_BYTE_CASES
|
#define HSPACE_CASES HSPACE_BYTE_CASES
|
||||||
|
|
||||||
|
@ -633,6 +634,7 @@ same code point. */
|
||||||
|
|
||||||
#define CHAR_ESC '\047'
|
#define CHAR_ESC '\047'
|
||||||
#define CHAR_DEL '\007'
|
#define CHAR_DEL '\007'
|
||||||
|
#define CHAR_NBSP ((unsigned char)'\x41')
|
||||||
#define STR_ESC "\047"
|
#define STR_ESC "\047"
|
||||||
#define STR_DEL "\007"
|
#define STR_DEL "\007"
|
||||||
|
|
||||||
|
@ -647,6 +649,7 @@ a positive value. */
|
||||||
#define CHAR_NEL ((unsigned char)'\x85')
|
#define CHAR_NEL ((unsigned char)'\x85')
|
||||||
#define CHAR_ESC '\033'
|
#define CHAR_ESC '\033'
|
||||||
#define CHAR_DEL '\177'
|
#define CHAR_DEL '\177'
|
||||||
|
#define CHAR_NBSP ((unsigned char)'\xa0')
|
||||||
|
|
||||||
#define STR_LF "\n"
|
#define STR_LF "\n"
|
||||||
#define STR_NL STR_LF
|
#define STR_NL STR_LF
|
||||||
|
@ -1029,6 +1032,7 @@ only. */
|
||||||
#define CHAR_VERTICAL_LINE '\174'
|
#define CHAR_VERTICAL_LINE '\174'
|
||||||
#define CHAR_RIGHT_CURLY_BRACKET '\175'
|
#define CHAR_RIGHT_CURLY_BRACKET '\175'
|
||||||
#define CHAR_TILDE '\176'
|
#define CHAR_TILDE '\176'
|
||||||
|
#define CHAR_NBSP ((unsigned char)'\xa0')
|
||||||
|
|
||||||
#define STR_HT "\011"
|
#define STR_HT "\011"
|
||||||
#define STR_VT "\013"
|
#define STR_VT "\013"
|
||||||
|
|
|
@ -29,13 +29,16 @@
|
||||||
|
|
||||||
/^A\ˆ/
|
/^A\ˆ/
|
||||||
A B
|
A B
|
||||||
|
A\x41B
|
||||||
|
|
||||||
# Test \H
|
# Test \H
|
||||||
|
|
||||||
/^A\È/
|
/^A\È/
|
||||||
AB
|
AB
|
||||||
|
A\x42B
|
||||||
** Fail
|
** Fail
|
||||||
A B
|
A B
|
||||||
|
A\x41B
|
||||||
|
|
||||||
# Test \R
|
# Test \R
|
||||||
|
|
||||||
|
|
|
@ -41,16 +41,22 @@ No match
|
||||||
/^A\ˆ/
|
/^A\ˆ/
|
||||||
A B
|
A B
|
||||||
0: A\x20
|
0: A\x20
|
||||||
|
A\x41B
|
||||||
|
0: AA
|
||||||
|
|
||||||
# Test \H
|
# Test \H
|
||||||
|
|
||||||
/^A\È/
|
/^A\È/
|
||||||
AB
|
AB
|
||||||
|
0: AB
|
||||||
|
A\x42B
|
||||||
0: AB
|
0: AB
|
||||||
** Fail
|
** Fail
|
||||||
No match
|
No match
|
||||||
A B
|
A B
|
||||||
No match
|
No match
|
||||||
|
A\x41B
|
||||||
|
No match
|
||||||
|
|
||||||
# Test \R
|
# Test \R
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue