Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 13 additions & 19 deletions clang/lib/Format/FormatToken.h
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,7 @@ struct AdditionalKeywords {
kw_verilogHashHash = &IdentTable.get("##");
kw_apostrophe = &IdentTable.get("\'");

// TableGen keywords
// TableGen keywords.
kw_bit = &IdentTable.get("bit");
kw_bits = &IdentTable.get("bits");
kw_code = &IdentTable.get("code");
Expand All @@ -1277,8 +1277,7 @@ struct AdditionalKeywords {
kw_multiclass = &IdentTable.get("multiclass");
kw_then = &IdentTable.get("then");

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

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

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

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

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

/// The Verilog keywords beyond the C++ keyword set.
Expand Down