aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@baylibre.com>2024-03-22 09:55:35 +0100
committerThomas Schwinge <tschwinge@baylibre.com>2024-03-22 09:55:35 +0100
commit59bc3e7924ed9dc293a77e3d9c6cdd99c252eefb (patch)
tree082840b53b888ace3053bb820baf83ee8b735eea
parent4c445f0015b9779d17d0ca7e8a6fc62cb5cf9e5a (diff)
parent00dea7e8c41b672730d6e2c891b6012a83d8842c (diff)
downloadgcc-59bc3e7924ed9dc293a77e3d9c6cdd99c252eefb.zip
gcc-59bc3e7924ed9dc293a77e3d9c6cdd99c252eefb.tar.gz
gcc-59bc3e7924ed9dc293a77e3d9c6cdd99c252eefb.tar.bz2
Merge commit '00dea7e8c41b672730d6e2c891b6012a83d8842c' into HEAD [#2284]
-rw-r--r--gcc/rust/lex/rust-lex.cc4
-rw-r--r--libcpp/charset.cc22
-rw-r--r--libcpp/include/cpplib.h8
3 files changed, 17 insertions, 17 deletions
diff --git a/gcc/rust/lex/rust-lex.cc b/gcc/rust/lex/rust-lex.cc
index 71775e8..bf6bf4c 100644
--- a/gcc/rust/lex/rust-lex.cc
+++ b/gcc/rust/lex/rust-lex.cc
@@ -128,13 +128,13 @@ is_non_decimal_int_literal_separator (uint32_t character)
bool
is_identifier_start (uint32_t codepoint)
{
- return (check_xid_property (codepoint) & XID_START) || codepoint == '_';
+ return (cpp_check_xid_property (codepoint) & CPP_XID_START) || codepoint == '_';
}
bool
is_identifier_continue (uint32_t codepoint)
{
- return check_xid_property (codepoint) & XID_CONTINUE;
+ return cpp_check_xid_property (codepoint) & CPP_XID_CONTINUE;
}
Lexer::Lexer (const std::string &input, Linemap *linemap)
diff --git a/libcpp/charset.cc b/libcpp/charset.cc
index 4d4d866..54d7b9e 100644
--- a/libcpp/charset.cc
+++ b/libcpp/charset.cc
@@ -1334,16 +1334,16 @@ _cpp_uname2c_uax44_lm2 (const char *name, size_t len, char *canon_name)
/* Returns flags representing the XID properties of the given codepoint. */
unsigned int
-check_xid_property (cppchar_t c)
+cpp_check_xid_property (cppchar_t c)
{
// fast path for ASCII
if (c < 0x80)
- {
- if (('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z'))
- return XID_START | XID_CONTINUE;
- if (('0' <= c && c <= '9') || c == '_')
- return XID_CONTINUE;
- }
+ {
+ if (('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z'))
+ return CPP_XID_START | CPP_XID_CONTINUE;
+ if (('0' <= c && c <= '9') || c == '_')
+ return CPP_XID_CONTINUE;
+ }
if (c > UCS_LIMIT)
return 0;
@@ -1355,17 +1355,17 @@ check_xid_property (cppchar_t c)
{
md = (mn + mx) / 2;
if (c <= ucnranges[md].end)
- mx = md;
+ mx = md;
else
- mn = md + 1;
+ mn = md + 1;
}
unsigned short flags = ucnranges[mn].flags;
if (flags & CXX23)
- return XID_START | XID_CONTINUE;
+ return CPP_XID_START | CPP_XID_CONTINUE;
if (flags & NXX23)
- return XID_CONTINUE;
+ return CPP_XID_CONTINUE;
return 0;
}
diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h
index 268a04e..5746aac 100644
--- a/libcpp/include/cpplib.h
+++ b/libcpp/include/cpplib.h
@@ -1631,11 +1631,11 @@ bool cpp_valid_utf8_p (const char *data, size_t num_bytes);
bool cpp_is_combining_char (cppchar_t c);
bool cpp_is_printable_char (cppchar_t c);
-enum {
- XID_START = 1,
- XID_CONTINUE = 2
+enum cpp_xid_property {
+ CPP_XID_START = 1,
+ CPP_XID_CONTINUE = 2
};
-unsigned int check_xid_property (cppchar_t c);
+unsigned int cpp_check_xid_property (cppchar_t c);
#endif /* ! LIBCPP_CPPLIB_H */