Skip to content

Commit 9bafaf6

Browse files
authored
[clang-format][NFC] Delete duplicates in CSharpExtraKeywords (#139199)
1 parent b35f6e2 commit 9bafaf6

File tree

1 file changed

+13
-19
lines changed

1 file changed

+13
-19
lines changed

clang/lib/Format/FormatToken.h

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,7 +1262,7 @@ struct AdditionalKeywords {
12621262
kw_verilogHashHash = &IdentTable.get("##");
12631263
kw_apostrophe = &IdentTable.get("\'");
12641264

1265-
// TableGen keywords
1265+
// TableGen keywords.
12661266
kw_bit = &IdentTable.get("bit");
12671267
kw_bits = &IdentTable.get("bits");
12681268
kw_code = &IdentTable.get("code");
@@ -1277,8 +1277,7 @@ struct AdditionalKeywords {
12771277
kw_multiclass = &IdentTable.get("multiclass");
12781278
kw_then = &IdentTable.get("then");
12791279

1280-
// Keep this at the end of the constructor to make sure everything here
1281-
// is
1280+
// Keep this at the end of the constructor to make sure everything here is
12821281
// already initialized.
12831282
JsExtraKeywords = std::unordered_set<IdentifierInfo *>(
12841283
{kw_as, kw_async, kw_await, kw_declare, kw_finally, kw_from,
@@ -1287,19 +1286,14 @@ struct AdditionalKeywords {
12871286
// Keywords from the Java section.
12881287
kw_abstract, kw_extends, kw_implements, kw_instanceof, kw_interface});
12891288

1290-
CSharpExtraKeywords = std::unordered_set<IdentifierInfo *>(
1291-
{kw_base, kw_byte, kw_checked, kw_decimal, kw_delegate, kw_event,
1292-
kw_fixed, kw_foreach, kw_implicit, kw_in, kw_init, kw_interface,
1293-
kw_internal, kw_is, kw_lock, kw_null, kw_object, kw_out, kw_override,
1294-
kw_params, kw_readonly, kw_ref, kw_string, kw_stackalloc, kw_sbyte,
1295-
kw_sealed, kw_uint, kw_ulong, kw_unchecked, kw_unsafe, kw_ushort,
1296-
kw_when, kw_where,
1297-
// Keywords from the JavaScript section.
1298-
kw_as, kw_async, kw_await, kw_declare, kw_finally, kw_from,
1299-
kw_function, kw_get, kw_import, kw_is, kw_let, kw_module, kw_readonly,
1300-
kw_set, kw_type, kw_typeof, kw_var, kw_yield,
1301-
// Keywords from the Java section.
1302-
kw_abstract, kw_extends, kw_implements, kw_instanceof, kw_interface});
1289+
CSharpExtraKeywords = JsExtraKeywords;
1290+
CSharpExtraKeywords.insert(
1291+
{kw_base, kw_byte, kw_checked, kw_decimal, kw_delegate,
1292+
kw_event, kw_fixed, kw_foreach, kw_implicit, kw_in,
1293+
kw_init, kw_internal, kw_lock, kw_null, kw_object,
1294+
kw_out, kw_params, kw_ref, kw_string, kw_stackalloc,
1295+
kw_sbyte, kw_sealed, kw_uint, kw_ulong, kw_unchecked,
1296+
kw_unsafe, kw_ushort, kw_when, kw_where});
13031297

13041298
// Some keywords are not included here because they don't need special
13051299
// treatment like `showcancelled` or they should be treated as identifiers
@@ -1706,8 +1700,8 @@ struct AdditionalKeywords {
17061700
}
17071701
}
17081702

1709-
/// Returns \c true if \p Tok is a C# keyword, returns
1710-
/// \c false if it is a anything else.
1703+
/// Returns \c true if \p Tok is a C# keyword, returns \c false if it is
1704+
/// anything else.
17111705
bool isCSharpKeyword(const FormatToken &Tok) const {
17121706
if (Tok.isAccessSpecifierKeyword())
17131707
return true;
@@ -1933,7 +1927,7 @@ struct AdditionalKeywords {
19331927
/// The JavaScript keywords beyond the C++ keyword set.
19341928
std::unordered_set<IdentifierInfo *> JsExtraKeywords;
19351929

1936-
/// The C# keywords beyond the C++ keyword set
1930+
/// The C# keywords beyond the C++ keyword set.
19371931
std::unordered_set<IdentifierInfo *> CSharpExtraKeywords;
19381932

19391933
/// The Verilog keywords beyond the C++ keyword set.

0 commit comments

Comments
 (0)