helpers.h 642 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. #ifndef CARBON_TOOLCHAIN_LEX_HELPERS_H_
  5. #define CARBON_TOOLCHAIN_LEX_HELPERS_H_
  6. #include "toolchain/diagnostics/emitter.h"
  7. namespace Carbon::Lex {
  8. // Should guard calls to getAsInteger due to performance issues with large
  9. // integers. Emits an error if the text cannot be lexed.
  10. auto CanLexInt(Diagnostics::Emitter<const char*>& emitter, llvm::StringRef text)
  11. -> bool;
  12. } // namespace Carbon::Lex
  13. #endif // CARBON_TOOLCHAIN_LEX_HELPERS_H_