lex_helpers.h 677 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_LEXER_LEX_HELPERS_H_
  5. #define CARBON_TOOLCHAIN_LEXER_LEX_HELPERS_H_
  6. #include "toolchain/diagnostics/diagnostic_emitter.h"
  7. namespace Carbon {
  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 CanLexInteger(DiagnosticEmitter<const char*>& emitter,
  11. llvm::StringRef text) -> bool;
  12. } // namespace Carbon
  13. #endif // CARBON_TOOLCHAIN_LEXER_LEX_HELPERS_H_