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);
2605 return !(*
this == R);
2632 if (llvm::find(Rule.Operators, Kind) != Rule.Operators.end())
2637 if (Kind == tok::greater &&
2638 llvm::find(Rule.Operators, tok::greatergreater) !=
2639 Rule.Operators.end()) {
2652 return Rule->MinChainLength;
2659 return !(*
this == R);
3649 return Binary == R.Binary &&
3976 std::vector<std::string>
Macros;
4107 return !(*
this == R);
5153 return !(*
this == R);
5529 Other.AfterFunctionDeclarationName &&
5856 return !(*
this == R);
6154 R.AlignConsecutiveShortCaseStatements &&
6156 R.AlignConsecutiveTableGenBreakingDAGArgColons &&
6158 R.AlignConsecutiveTableGenCondOperatorColons &&
6160 R.AlignConsecutiveTableGenDefinitionColons &&
6166 R.AllowAllParametersOfDeclarationOnNextLine &&
6168 R.AllowBreakBeforeNoexceptSpecifier &&
6172 R.AllowShortCaseExpressionOnASingleLine &&
6174 R.AllowShortCaseLabelsOnASingleLine &&
6176 R.AllowShortCompoundRequirementOnASingleLine &&
6179 R.AllowShortFunctionsOnASingleLine &&
6181 R.AllowShortIfStatementsOnASingleLine &&
6185 R.AllowShortNamespacesOnASingleLine &&
6188 R.AlwaysBreakBeforeMultilineStrings &&
6197 R.BreakAfterOpenBracketBracedList &&
6207 R.BreakBeforeCloseBracketBracedList &&
6209 R.BreakBeforeCloseBracketFunction &&
6221 R.BreakFunctionDeclarationParameters &&
6223 R.BreakFunctionDefinitionParameters &&
6230 R.ConstructorInitializerIndentWidth &&
6239 R.ExperimentalAutoDetectBinPacking &&
6242 IncludeStyle.IncludeBlocks == R.IncludeStyle.IncludeBlocks &&
6243 IncludeStyle.IncludeCategories == R.IncludeStyle.IncludeCategories &&
6245 R.IncludeStyle.IncludeIsMainRegex &&
6247 R.IncludeStyle.IncludeIsMainSourceRegex &&
6248 IncludeStyle.MainIncludeChar == R.IncludeStyle.MainIncludeChar &&
6271 R.MacrosSkippedByRemoveParentheses &&
6279 R.ObjCBreakBeforeNestedBlockParam &&
6282 R.ObjCSpaceAfterMethodDeclarationPrefix &&
6291 R.PenaltyBreakBeforeFirstCallParameter &&
6299 R.PenaltyBreakTemplateDeclaration &&
6309 R.RemoveEmptyLinesInUnwrappedLines &&
6327 R.SpaceBeforeCtorInitializerColon &&
6334 R.SpaceBeforeRangeBasedForLoopColon &&
6339 SpacesInBlockComments == R.SpacesInBlockComments &&
6342 R.SpacesInLineCommentPrefix.Minimum &&
6344 R.SpacesInLineCommentPrefix.Maximum &&
6352 R.TableGenBreakingDAGArgOperators &&
6358 R.VerilogBreakBetweenInstancePorts &&
6373 typedef std::map<LanguageKind, FormatStyle>
MapType;
6388 std::shared_ptr<MapType> Styles;
6393 const std::vector<FormatStyle> &ConfigurationStyles);
6396 FormatStyleSet StyleSet;
6398 friend std::error_code
6400 bool AllowUnknownOptions,
6401 llvm::SourceMgr::DiagHandlerTy DiagHandler,
6402 void *DiagHandlerCtxt,
bool IsDotHFile);
6466 bool AllowUnknownOptions =
false,
6467 llvm::SourceMgr::DiagHandlerTy DiagHandler =
nullptr,
6468 void *DiagHandlerCtx =
nullptr,
bool IsDotHFile =
false);
6472 bool AllowUnknownOptions =
false,
6473 bool IsDotHFile =
false) {
6475 AllowUnknownOptions,
nullptr,
6476 nullptr, IsDotHFile);
6487 unsigned *Cursor =
nullptr);
6546 StringRef
FileName,
bool *IncompleteFormat);
6635 StringRef Code =
"", llvm::vfs::FileSystem *FS =
nullptr,
6636 bool AllowUnknownOptions =
false,
6637 llvm::SourceMgr::DiagHandlerTy DiagHandler =
nullptr);
6653 return "Objective-C";
6657 return "JavaScript";
6680struct 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.