mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 08:34:43 +01:00
Cleanup or suppress numerous clang-tidy issues. (#577)
This gets us to a nearly clean state across the toolchain. A couple of these are checks that I don't think we want to try to rigidly use and I've disabled them completely. Others I've added relevant `NOLINT` style suppressions or applied the automatic fix suggested by `clang-tidy`. The implicit conversions that are allowed here with `NOLINT` are probably worth at least a tiny bit of scrutiny to see if we could replace the construct with something more direct without undue effort and no longer need the implicit conversion. But until then, it seemed fine to suppress.
This commit is contained in:
@@ -34,16 +34,19 @@ class ParseTree::Parser {
|
||||
}
|
||||
|
||||
// Gets the kind of the next token to be consumed.
|
||||
auto NextTokenKind() const -> TokenKind { return tokens.GetKind(*position); }
|
||||
[[nodiscard]] auto NextTokenKind() const -> TokenKind {
|
||||
return tokens.GetKind(*position);
|
||||
}
|
||||
|
||||
// Tests whether the next token to be consumed is of the specified kind.
|
||||
auto NextTokenIs(TokenKind kind) const -> bool {
|
||||
[[nodiscard]] auto NextTokenIs(TokenKind kind) const -> bool {
|
||||
return NextTokenKind() == kind;
|
||||
}
|
||||
|
||||
// Tests whether the next token to be consumed is of any of the specified
|
||||
// kinds.
|
||||
auto NextTokenIsOneOf(std::initializer_list<TokenKind> kinds) const -> bool {
|
||||
[[nodiscard]] auto NextTokenIsOneOf(
|
||||
std::initializer_list<TokenKind> kinds) const -> bool {
|
||||
return NextTokenKind().IsOneOf(kinds);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user