Remove unused character flag ctype_meta, no longer used.

This commit is contained in:
Philip.Hazel 2018-08-19 15:44:06 +00:00
parent 6e6bb40a3d
commit 91715304cb
4 changed files with 24 additions and 22 deletions

View File

@ -165,6 +165,9 @@ negative class with no characters less than 0x100 followed by a positive class
with only characters less than 0x100, the first class was incorrectly being with only characters less than 0x100, the first class was incorrectly being
auto-possessified, causing incorrect match failures. auto-possessified, causing incorrect match failures.
36. Removed the character type bit ctype_meta, which dates from PCRE1 and is
not used in PCRE2.
Version 10.31 12-February-2018 Version 10.31 12-February-2018
------------------------------ ------------------------------

View File

@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge Original API code Copyright (c) 1997-2012 University of Cambridge
New API code Copyright (c) 2016 University of Cambridge New API code Copyright (c) 2016-2018 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
@ -104,6 +104,14 @@ fprintf(f,
"tables are passed to PCRE2 by the application that calls it. The tables\n" "tables are passed to PCRE2 by the application that calls it. The tables\n"
"are used only for characters whose code values are less than 256. */\n\n"); "are used only for characters whose code values are less than 256. */\n\n");
fprintf(f,
"/*The dftables program (which is distributed with PCRE2) can be used to\n"
"build alternative versions of this file. This is necessary if you are\n"
"running in an EBCDIC environment, or if you want to default to a different\n"
"encoding, for example ISO-8859-1. When dftables is run, it creates these\n"
"tables in the current locale. This happens automatically if PCRE2 is\n"
"configured with --enable-rebuild-chartables. */\n\n");
/* Force config.h in z/OS */ /* Force config.h in z/OS */
#if defined NATIVE_ZOS #if defined NATIVE_ZOS
@ -115,7 +123,7 @@ fprintf(f,
#endif #endif
fprintf(f, fprintf(f,
"/* The following #includes are present because without them gcc 4.x may remove\n" "/* The following #include is present because without it gcc 4.x may remove\n"
"the array definition from the final binary if PCRE2 is built into a static\n" "the array definition from the final binary if PCRE2 is built into a static\n"
"library and dead code stripping is activated. This leads to link errors.\n" "library and dead code stripping is activated. This leads to link errors.\n"
"Pulling in the header ensures that the array gets flagged as \"someone\n" "Pulling in the header ensures that the array gets flagged as \"someone\n"
@ -153,11 +161,10 @@ for (i = 0; i < 256; i++)
fprintf(f, ",\n\n"); fprintf(f, ",\n\n");
fprintf(f, fprintf(f,
"/* This table contains bit maps for various character classes.\n" "/* This table contains bit maps for various character classes. Each map is 32\n"
"Each map is 32 bytes long and the bits run from the least\n" "bytes long and the bits run from the least significant end of each byte. The\n"
"significant end of each byte. The classes that have their own\n" "classes that have their own maps are: space, xdigit, digit, upper, lower, word,\n"
"maps are: space, xdigit, digit, upper, lower, word, graph\n" "graph print, punct, and cntrl. Other classes are built from combinations. */\n\n");
"print, punct, and cntrl. Other classes are built from combinations. */\n\n");
fprintf(f, " "); fprintf(f, " ");
for (i = 0; i < cbit_length; i++) for (i = 0; i < cbit_length; i++)
@ -178,10 +185,8 @@ fprintf(f,
" 0x%02x letter\n" " 0x%02x letter\n"
" 0x%02x decimal digit\n" " 0x%02x decimal digit\n"
" 0x%02x hexadecimal digit\n" " 0x%02x hexadecimal digit\n"
" 0x%02x alphanumeric or '_'\n" " 0x%02x alphanumeric or '_'\n*/\n\n",
" 0x%02x regular expression metacharacter or binary zero\n*/\n\n", ctype_space, ctype_letter, ctype_digit, ctype_xdigit, ctype_word);
ctype_space, ctype_letter, ctype_digit, ctype_xdigit, ctype_word,
ctype_meta);
fprintf(f, " "); fprintf(f, " ");
for (i = 0; i < 256; i++) for (i = 0; i < 256; i++)

View File

@ -565,14 +565,15 @@ these tables. */
#define cbit_cntrl 288 /* [:cntrl:] */ #define cbit_cntrl 288 /* [:cntrl:] */
#define cbit_length 320 /* Length of the cbits table */ #define cbit_length 320 /* Length of the cbits table */
/* Bit definitions for entries in the ctypes table. */ /* Bit definitions for entries in the ctypes table. Do not change these values
without checking pcre2_jit_compile.c, which has an assertion to ensure that
ctype_word has the value 16. */
#define ctype_space 0x01 #define ctype_space 0x01
#define ctype_letter 0x02 #define ctype_letter 0x02
#define ctype_digit 0x04 #define ctype_digit 0x04
#define ctype_xdigit 0x08 #define ctype_xdigit 0x08 /* not actually used any more */
#define ctype_word 0x10 /* alphanumeric or '_' */ #define ctype_word 0x10 /* alphanumeric or '_' */
#define ctype_meta 0x80 /* regexp meta char or zero (end pattern) */
/* Offsets of the various tables from the base tables pointer, and /* Offsets of the various tables from the base tables pointer, and
total length of the tables. */ total length of the tables. */

View File

@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge Original API code Copyright (c) 1997-2012 University of Cambridge
New API code Copyright (c) 2016 University of Cambridge New API code Copyright (c) 2016-2018 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
@ -141,13 +141,6 @@ for (i = 0; i < 256; i++)
if (isdigit(i)) x += ctype_digit; if (isdigit(i)) x += ctype_digit;
if (isxdigit(i)) x += ctype_xdigit; if (isxdigit(i)) x += ctype_xdigit;
if (isalnum(i) || i == '_') x += ctype_word; if (isalnum(i) || i == '_') x += ctype_word;
/* Note: strchr includes the terminating zero in the characters it considers.
In this instance, that is ok because we want binary zero to be flagged as a
meta-character, which in this sense is any character that terminates a run
of data characters. */
if (strchr("\\*+?{^.$|()[", i) != 0) x += ctype_meta;
*p++ = x; *p++ = x;
} }