parse_node_kind.cpp 562 B

12345678910111213141516171819
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. #include "toolchain/parser/parse_node_kind.h"
  5. #include "llvm/ADT/StringRef.h"
  6. namespace Carbon {
  7. auto ParseNodeKind::name() const -> llvm::StringRef {
  8. static constexpr llvm::StringLiteral Names[] = {
  9. #define CARBON_PARSE_NODE_KIND(Name) #Name,
  10. #include "toolchain/parser/parse_node_kind.def"
  11. };
  12. return Names[static_cast<int>(kind_)];
  13. }
  14. } // namespace Carbon