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"
25#include <system_error>
48 const char *
name()
const noexcept override;
49 std::string
message(
int EV)
const override;
273 return !(*
this == R);
629 return !(*
this == R);
2589 return !(*
this == R);
2616 if (llvm::find(Rule.Operators, Kind) != Rule.Operators.end())
2621 if (Kind == tok::greater &&
2622 llvm::find(Rule.Operators, tok::greatergreater) !=
2623 Rule.Operators.end()) {
2636 return Rule->MinChainLength;
2643 return !(*
this == R);
3633 return Binary == R.Binary &&
3960 std::vector<std::string>
Macros;
4091 return !(*
this == R);
5114 return !(*
this == R);
5490 Other.AfterFunctionDeclarationName &&
5817 return !(*
this == R);
6115 R.AlignConsecutiveShortCaseStatements &&
6117 R.AlignConsecutiveTableGenBreakingDAGArgColons &&
6119 R.AlignConsecutiveTableGenCondOperatorColons &&
6121 R.AlignConsecutiveTableGenDefinitionColons &&
6127 R.AllowAllParametersOfDeclarationOnNextLine &&
6129 R.AllowBreakBeforeNoexceptSpecifier &&
6133 R.AllowShortCaseExpressionOnASingleLine &&
6135 R.AllowShortCaseLabelsOnASingleLine &&
6137 R.AllowShortCompoundRequirementOnASingleLine &&
6140 R.AllowShortFunctionsOnASingleLine &&
6142 R.AllowShortIfStatementsOnASingleLine &&
6146 R.AllowShortNamespacesOnASingleLine &&
6149 R.AlwaysBreakBeforeMultilineStrings &&
6158 R.BreakAfterOpenBracketBracedList &&
6168 R.BreakBeforeCloseBracketBracedList &&
6170 R.BreakBeforeCloseBracketFunction &&
6182 R.BreakFunctionDeclarationParameters &&
6184 R.BreakFunctionDefinitionParameters &&
6191 R.ConstructorInitializerIndentWidth &&
6200 R.ExperimentalAutoDetectBinPacking &&
6203 IncludeStyle.IncludeBlocks == R.IncludeStyle.IncludeBlocks &&
6204 IncludeStyle.IncludeCategories == R.IncludeStyle.IncludeCategories &&
6206 R.IncludeStyle.IncludeIsMainRegex &&
6208 R.IncludeStyle.IncludeIsMainSourceRegex &&
6209 IncludeStyle.MainIncludeChar == R.IncludeStyle.MainIncludeChar &&
6232 R.MacrosSkippedByRemoveParentheses &&
6240 R.ObjCBreakBeforeNestedBlockParam &&
6243 R.ObjCSpaceAfterMethodDeclarationPrefix &&
6252 R.PenaltyBreakBeforeFirstCallParameter &&
6260 R.PenaltyBreakTemplateDeclaration &&
6270 R.RemoveEmptyLinesInUnwrappedLines &&
6288 R.SpaceBeforeCtorInitializerColon &&
6295 R.SpaceBeforeRangeBasedForLoopColon &&
6300 SpacesInBlockComments == R.SpacesInBlockComments &&
6303 R.SpacesInLineCommentPrefix.Minimum &&
6305 R.SpacesInLineCommentPrefix.Maximum &&
6313 R.TableGenBreakingDAGArgOperators &&
6319 R.VerilogBreakBetweenInstancePorts &&
6334 typedef std::map<LanguageKind, FormatStyle>
MapType;
6349 std::shared_ptr<MapType> Styles;
6354 const std::vector<FormatStyle> &ConfigurationStyles);
6357 FormatStyleSet StyleSet;
6359 friend std::error_code
6361 bool AllowUnknownOptions,
6362 llvm::SourceMgr::DiagHandlerTy DiagHandler,
6363 void *DiagHandlerCtxt,
bool IsDotHFile);
6427 bool AllowUnknownOptions =
false,
6428 llvm::SourceMgr::DiagHandlerTy DiagHandler =
nullptr,
6429 void *DiagHandlerCtx =
nullptr,
bool IsDotHFile =
false);
6433 bool AllowUnknownOptions =
false,
6434 bool IsDotHFile =
false) {
6436 AllowUnknownOptions,
nullptr,
6437 nullptr, IsDotHFile);
6448 unsigned *Cursor =
nullptr);
6507 StringRef
FileName,
bool *IncompleteFormat);
6596 StringRef Code =
"", llvm::vfs::FileSystem *FS =
nullptr,
6597 bool AllowUnknownOptions =
false,
6598 llvm::SourceMgr::DiagHandlerTy DiagHandler =
nullptr);
6614 return "Objective-C";
6618 return "JavaScript";
6641struct 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.
Diagnostic wrappers for TextAPI types for error reporting.