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);
2580 return !(*
this == R);
2607 if (llvm::find(Rule.Operators, Kind) != Rule.Operators.end())
2612 if (Kind == tok::greater &&
2613 llvm::find(Rule.Operators, tok::greatergreater) !=
2614 Rule.Operators.end()) {
2627 return Rule->MinChainLength;
2634 return !(*
this == R);
3624 return Binary == R.Binary &&
3951 std::vector<std::string>
Macros;
4082 return !(*
this == R);
5091 return !(*
this == R);
5467 Other.AfterFunctionDeclarationName &&
5794 return !(*
this == R);
6092 R.AlignConsecutiveShortCaseStatements &&
6094 R.AlignConsecutiveTableGenBreakingDAGArgColons &&
6096 R.AlignConsecutiveTableGenCondOperatorColons &&
6098 R.AlignConsecutiveTableGenDefinitionColons &&
6104 R.AllowAllParametersOfDeclarationOnNextLine &&
6106 R.AllowBreakBeforeNoexceptSpecifier &&
6110 R.AllowShortCaseExpressionOnASingleLine &&
6112 R.AllowShortCaseLabelsOnASingleLine &&
6114 R.AllowShortCompoundRequirementOnASingleLine &&
6117 R.AllowShortFunctionsOnASingleLine &&
6119 R.AllowShortIfStatementsOnASingleLine &&
6123 R.AllowShortNamespacesOnASingleLine &&
6126 R.AlwaysBreakBeforeMultilineStrings &&
6135 R.BreakAfterOpenBracketBracedList &&
6145 R.BreakBeforeCloseBracketBracedList &&
6147 R.BreakBeforeCloseBracketFunction &&
6159 R.BreakFunctionDeclarationParameters &&
6161 R.BreakFunctionDefinitionParameters &&
6168 R.ConstructorInitializerIndentWidth &&
6177 R.ExperimentalAutoDetectBinPacking &&
6180 IncludeStyle.IncludeBlocks == R.IncludeStyle.IncludeBlocks &&
6181 IncludeStyle.IncludeCategories == R.IncludeStyle.IncludeCategories &&
6183 R.IncludeStyle.IncludeIsMainRegex &&
6185 R.IncludeStyle.IncludeIsMainSourceRegex &&
6186 IncludeStyle.MainIncludeChar == R.IncludeStyle.MainIncludeChar &&
6209 R.MacrosSkippedByRemoveParentheses &&
6217 R.ObjCBreakBeforeNestedBlockParam &&
6220 R.ObjCSpaceAfterMethodDeclarationPrefix &&
6229 R.PenaltyBreakBeforeFirstCallParameter &&
6237 R.PenaltyBreakTemplateDeclaration &&
6247 R.RemoveEmptyLinesInUnwrappedLines &&
6265 R.SpaceBeforeCtorInitializerColon &&
6272 R.SpaceBeforeRangeBasedForLoopColon &&
6277 SpacesInBlockComments == R.SpacesInBlockComments &&
6280 R.SpacesInLineCommentPrefix.Minimum &&
6282 R.SpacesInLineCommentPrefix.Maximum &&
6290 R.TableGenBreakingDAGArgOperators &&
6296 R.VerilogBreakBetweenInstancePorts &&
6311 typedef std::map<LanguageKind, FormatStyle>
MapType;
6326 std::shared_ptr<MapType> Styles;
6331 const std::vector<FormatStyle> &ConfigurationStyles);
6334 FormatStyleSet StyleSet;
6336 friend std::error_code
6338 bool AllowUnknownOptions,
6339 llvm::SourceMgr::DiagHandlerTy DiagHandler,
6340 void *DiagHandlerCtxt,
bool IsDotHFile);
6404 bool AllowUnknownOptions =
false,
6405 llvm::SourceMgr::DiagHandlerTy DiagHandler =
nullptr,
6406 void *DiagHandlerCtx =
nullptr,
bool IsDotHFile =
false);
6410 bool AllowUnknownOptions =
false,
6411 bool IsDotHFile =
false) {
6413 AllowUnknownOptions,
nullptr,
6414 nullptr, IsDotHFile);
6425 unsigned *Cursor =
nullptr);
6484 StringRef
FileName,
bool *IncompleteFormat);
6573 StringRef Code =
"", llvm::vfs::FileSystem *FS =
nullptr,
6574 bool AllowUnknownOptions =
false,
6575 llvm::SourceMgr::DiagHandlerTy DiagHandler =
nullptr);
6591 return "Objective-C";
6595 return "JavaScript";
6618struct 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.
The JSON file list parser is used to communicate input to InstallAPI.
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.