14#ifndef LLVM_CLANG_FORMAT_FORMAT_H
15#define LLVM_CLANG_FORMAT_FORMAT_H
21#include "llvm/ADT/ArrayRef.h"
22#include "llvm/Support/Regex.h"
23#include "llvm/Support/SourceMgr.h"
24#include "llvm/Support/VirtualFileSystemFwd.h"
26#include <system_error>
43 const char *
name()
const noexcept override;
44 std::string
message(
int EV)
const override;
268 return !(*
this == R);
624 return !(*
this == R);
2600 return !(*
this == R);
2627 if (llvm::find(Rule.Operators, Kind) != Rule.Operators.end())
2632 if (Kind == tok::greater &&
2633 llvm::find(Rule.Operators, tok::greatergreater) !=
2634 Rule.Operators.end()) {
2647 return Rule->MinChainLength;
2654 return !(*
this == R);
3660 return Binary == R.Binary &&
3997 std::vector<std::string>
Macros;
4128 return !(*
this == R);
5174 return !(*
this == R);
5550 Other.AfterFunctionDeclarationName &&
5877 return !(*
this == R);
6175 R.AlignConsecutiveShortCaseStatements &&
6177 R.AlignConsecutiveTableGenBreakingDAGArgColons &&
6179 R.AlignConsecutiveTableGenCondOperatorColons &&
6181 R.AlignConsecutiveTableGenDefinitionColons &&
6187 R.AllowAllParametersOfDeclarationOnNextLine &&
6189 R.AllowBreakBeforeNoexceptSpecifier &&
6193 R.AllowShortCaseExpressionOnASingleLine &&
6195 R.AllowShortCaseLabelsOnASingleLine &&
6197 R.AllowShortCompoundRequirementOnASingleLine &&
6200 R.AllowShortFunctionsOnASingleLine &&
6202 R.AllowShortIfStatementsOnASingleLine &&
6206 R.AllowShortNamespacesOnASingleLine &&
6209 R.AlwaysBreakBeforeMultilineStrings &&
6218 R.BreakAfterOpenBracketBracedList &&
6228 R.BreakBeforeCloseBracketBracedList &&
6230 R.BreakBeforeCloseBracketFunction &&
6242 R.BreakFunctionDeclarationParameters &&
6244 R.BreakFunctionDefinitionParameters &&
6251 R.ConstructorInitializerIndentWidth &&
6260 R.ExperimentalAutoDetectBinPacking &&
6263 IncludeStyle.IncludeBlocks == R.IncludeStyle.IncludeBlocks &&
6264 IncludeStyle.IncludeCategories == R.IncludeStyle.IncludeCategories &&
6266 R.IncludeStyle.IncludeIsMainRegex &&
6268 R.IncludeStyle.IncludeIsMainSourceRegex &&
6269 IncludeStyle.MainIncludeChar == R.IncludeStyle.MainIncludeChar &&
6292 R.MacrosSkippedByRemoveParentheses &&
6300 R.ObjCBreakBeforeNestedBlockParam &&
6303 R.ObjCSpaceAfterMethodDeclarationPrefix &&
6312 R.PenaltyBreakBeforeFirstCallParameter &&
6320 R.PenaltyBreakTemplateDeclaration &&
6330 R.RemoveEmptyLinesInUnwrappedLines &&
6348 R.SpaceBeforeCtorInitializerColon &&
6355 R.SpaceBeforeRangeBasedForLoopColon &&
6360 SpacesInBlockComments == R.SpacesInBlockComments &&
6363 R.SpacesInLineCommentPrefix.Minimum &&
6365 R.SpacesInLineCommentPrefix.Maximum &&
6373 R.TableGenBreakingDAGArgOperators &&
6379 R.VerilogBreakBetweenInstancePorts &&
6394 typedef std::map<LanguageKind, FormatStyle>
MapType;
6409 std::shared_ptr<MapType> Styles;
6414 const std::vector<FormatStyle> &ConfigurationStyles);
6417 FormatStyleSet StyleSet;
6419 friend std::error_code
6421 bool AllowUnknownOptions,
6422 llvm::SourceMgr::DiagHandlerTy DiagHandler,
6423 void *DiagHandlerCtxt,
bool IsDotHFile);
6487 bool AllowUnknownOptions =
false,
6488 llvm::SourceMgr::DiagHandlerTy DiagHandler =
nullptr,
6489 void *DiagHandlerCtx =
nullptr,
bool IsDotHFile =
false);
6493 bool AllowUnknownOptions =
false,
6494 bool IsDotHFile =
false) {
6496 AllowUnknownOptions,
nullptr,
6497 nullptr, IsDotHFile);
6508 unsigned *Cursor =
nullptr);
6567 StringRef
FileName,
bool *IncompleteFormat);
6656 StringRef Code =
"", llvm::vfs::FileSystem *FS =
nullptr,
6657 bool AllowUnknownOptions =
false,
6658 llvm::SourceMgr::DiagHandlerTy DiagHandler =
nullptr);
6674 return "Objective-C";
6678 return "JavaScript";
6701struct std::is_error_code_enum<
clang::format::ParseError> : std::true_type {};
Defines the clang::LangOptions interface.
Defines the clang::TokenKind enum and support functions.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
TokenKind
Provides a simple uniform namespace for tokens from all C languages.
Top level wrappers for InstallAPI frontend operations.
Language
The language for the input, used to select and validate the language standard and possible actions.
int32_t uint32_t uint32_t int8_t