brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · e24af18 Raw
40 lines · c
1//===--- IntegerLiteralSeparatorFixer.h -------------------------*- C++ -*-===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8///9/// \file10/// This file declares IntegerLiteralSeparatorFixer that fixes C++ integer11/// literal separators.12///13//===----------------------------------------------------------------------===//14 15#ifndef LLVM_CLANG_LIB_FORMAT_INTEGERLITERALSEPARATORFIXER_H16#define LLVM_CLANG_LIB_FORMAT_INTEGERLITERALSEPARATORFIXER_H17 18#include "TokenAnalyzer.h"19 20namespace clang {21namespace format {22 23class IntegerLiteralSeparatorFixer {24public:25  std::pair<tooling::Replacements, unsigned> process(const Environment &Env,26                                                     const FormatStyle &Style);27 28private:29  bool checkSeparator(StringRef IntegerLiteral, int DigitsPerGroup) const;30  std::string format(StringRef IntegerLiteral, int DigitsPerGroup,31                     int DigitCount, bool RemoveSeparator) const;32 33  char Separator;34};35 36} // end namespace format37} // end namespace clang38 39#endif40