format.h 770 B

1234567891011121314151617181920
  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_FORMAT_FORMAT_H_
  5. #define CARBON_TOOLCHAIN_FORMAT_FORMAT_H_
  6. #include "common/ostream.h"
  7. #include "toolchain/lex/tokenized_buffer.h"
  8. namespace Carbon::Format {
  9. // Formats file content (based on tokens) to the out stream. Returns false if
  10. // there was an error during formatting, and the formatted stream shouldn't be
  11. // used (in that case, the caller might want to use the original content).
  12. auto Format(const Lex::TokenizedBuffer& tokens, llvm::raw_ostream& out) -> bool;
  13. } // namespace Carbon::Format
  14. #endif // CARBON_TOOLCHAIN_FORMAT_FORMAT_H_