Path: blob/main/contrib/llvm-project/clang/lib/Format/DefinitionBlockSeparator.h
35233 views
//===--- DefinitionBlockSeparator.h -----------------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7///8/// \file9/// This file declares DefinitionBlockSeparator, a TokenAnalyzer that inserts or10/// removes empty lines separating definition blocks like classes, structs,11/// functions, enums, and namespaces in between.12///13//===----------------------------------------------------------------------===//1415#ifndef LLVM_CLANG_LIB_FORMAT_DEFINITIONBLOCKSEPARATOR_H16#define LLVM_CLANG_LIB_FORMAT_DEFINITIONBLOCKSEPARATOR_H1718#include "TokenAnalyzer.h"19#include "WhitespaceManager.h"2021namespace clang {22namespace format {23class DefinitionBlockSeparator : public TokenAnalyzer {24public:25DefinitionBlockSeparator(const Environment &Env, const FormatStyle &Style)26: TokenAnalyzer(Env, Style) {}2728std::pair<tooling::Replacements, unsigned>29analyze(TokenAnnotator &Annotator,30SmallVectorImpl<AnnotatedLine *> &AnnotatedLines,31FormatTokenLexer &Tokens) override;3233private:34void separateBlocks(SmallVectorImpl<AnnotatedLine *> &Lines,35tooling::Replacements &Result, FormatTokenLexer &Tokens);36};37} // namespace format38} // namespace clang3940#endif414243