diff options
Diffstat (limited to 're2/unicode_groups.h')
-rw-r--r-- | re2/unicode_groups.h | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/re2/unicode_groups.h b/re2/unicode_groups.h index f91c51f..75f55da 100644 --- a/re2/unicode_groups.h +++ b/re2/unicode_groups.h @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +#ifndef RE2_UNICODE_GROUPS_H_ +#define RE2_UNICODE_GROUPS_H_ + // Unicode character groups. // The codes get split into ranges of 16-bit codes @@ -15,50 +18,50 @@ // to 16.5 kB of data but make the data harder to use; // we don't bother. -#ifndef RE2_UNICODE_GROUPS_H__ -#define RE2_UNICODE_GROUPS_H__ +#include <stdint.h> #include "util/util.h" +#include "util/utf.h" namespace re2 { struct URange16 { - uint16 lo; - uint16 hi; + uint16_t lo; + uint16_t hi; }; struct URange32 { - uint32 lo; - uint32 hi; + Rune lo; + Rune hi; }; struct UGroup { const char *name; int sign; // +1 for [abc], -1 for [^abc] - URange16 *r16; + const URange16 *r16; int nr16; - URange32 *r32; + const URange32 *r32; int nr32; }; // Named by property or script name (e.g., "Nd", "N", "Han"). // Negated groups are not included. -extern UGroup unicode_groups[]; -extern int num_unicode_groups; +extern const UGroup unicode_groups[]; +extern const int num_unicode_groups; // Named by POSIX name (e.g., "[:alpha:]", "[:^lower:]"). // Negated groups are included. -extern UGroup posix_groups[]; -extern int num_posix_groups; +extern const UGroup posix_groups[]; +extern const int num_posix_groups; // Named by Perl name (e.g., "\\d", "\\D"). // Negated groups are included. -extern UGroup perl_groups[]; -extern int num_perl_groups; +extern const UGroup perl_groups[]; +extern const int num_perl_groups; } // namespace re2 -#endif // RE2_UNICODE_GROUPS_H__ +#endif // RE2_UNICODE_GROUPS_H_ |