mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 20:40:11 +01:00
This extracts out the SourceBuffer handling of `-` in order to trivially share it. Note this still has a number of TODOs, it's just setting up the essential subcommand infrastructure, with some tests demonstrating that it at least does something.
21 lines
770 B
C++
21 lines
770 B
C++
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
#ifndef CARBON_TOOLCHAIN_FORMAT_FORMAT_H_
|
|
#define CARBON_TOOLCHAIN_FORMAT_FORMAT_H_
|
|
|
|
#include "common/ostream.h"
|
|
#include "toolchain/lex/tokenized_buffer.h"
|
|
|
|
namespace Carbon::Format {
|
|
|
|
// Formats file content (based on tokens) to the out stream. Returns false if
|
|
// there was an error during formatting, and the formatted stream shouldn't be
|
|
// used (in that case, the caller might want to use the original content).
|
|
auto Format(const Lex::TokenizedBuffer& tokens, llvm::raw_ostream& out) -> bool;
|
|
|
|
} // namespace Carbon::Format
|
|
|
|
#endif // CARBON_TOOLCHAIN_FORMAT_FORMAT_H_
|