LLDB mainline
Macros | Functions
ClangHighlighter.cpp File Reference
#include "ClangHighlighter.h"
#include "lldb/Host/FileSystem.h"
#include "lldb/Target/Language.h"
#include "lldb/Utility/AnsiTerminal.h"
#include "lldb/Utility/StreamString.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Lex/Lexer.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/Support/MemoryBuffer.h"
#include <optional>
#include "clang/Basic/TokenKinds.def"

Go to the source code of this file.

Macros

#define KEYWORD(X, N)   keywords.insert(#X);
 

Functions

static HighlightStyle::ColorStyle determineClangStyle (const ClangHighlighter &highlighter, const clang::Token &token, llvm::StringRef tok_str, const HighlightStyle &options, bool &in_pp_directive)
 Determines which style should be applied to the given token.
 

Macro Definition Documentation

◆ KEYWORD

#define KEYWORD (   X,
 
)    keywords.insert(#X);

Function Documentation

◆ determineClangStyle()

static HighlightStyle::ColorStyle determineClangStyle ( const ClangHighlighter highlighter,
const clang::Token &  token,
llvm::StringRef  tok_str,
const HighlightStyle options,
bool &  in_pp_directive 
)
static

Determines which style should be applied to the given token.

Parameters
highlighterThe current highlighter that should use the style.
tokenThe current token.
tok_strThe string in the source code the token represents.
optionsThe style we use for coloring the source code.
in_pp_directiveIf we are currently in a preprocessor directive. NOTE: This is passed by reference and will be updated if the current token starts or ends a preprocessor directive.
Returns
The ColorStyle that should be applied to the token.

Definition at line 50 of file ClangHighlighter.cpp.

References lldb_private::HighlightStyle::braces, lldb_private::HighlightStyle::colon, lldb_private::HighlightStyle::comma, lldb_private::HighlightStyle::comment, lldb_private::HighlightStyle::identifier, lldb_private::ClangHighlighter::isKeyword(), lldb_private::HighlightStyle::keyword, lldb_private::HighlightStyle::operators, lldb_private::HighlightStyle::parentheses, lldb_private::HighlightStyle::pp_directive, lldb_private::HighlightStyle::scalar_literal, lldb_private::HighlightStyle::square_brackets, and lldb_private::HighlightStyle::string_literal.

Referenced by lldb_private::ClangHighlighter::Highlight().