LLVM 22.0.0git
Classes | Typedefs | Functions
llvm::mustache Namespace Reference

Classes

class  AddIndentationStringStream
 
class  ASTNode
 
class  EscapeStringStream
 
class  Parser
 
class  Template
 
class  Token
 

Typedefs

using Lambda = std::function< llvm::json::Value()>
 
using SectionLambda = std::function< llvm::json::Value(std::string)>
 
using AstPtr = std::unique_ptr< ASTNode >
 
using EscapeMap = DenseMap< char, std::string >
 

Functions

AstPtr createRootNode (llvm::StringMap< AstPtr > &Partials, llvm::StringMap< Lambda > &Lambdas, llvm::StringMap< SectionLambda > &SectionLambdas, EscapeMap &Escapes)
 
AstPtr createNode (ASTNode::Type T, Accessor A, ASTNode *Parent, llvm::StringMap< AstPtr > &Partials, llvm::StringMap< Lambda > &Lambdas, llvm::StringMap< SectionLambda > &SectionLambdas, EscapeMap &Escapes)
 
AstPtr createTextNode (std::string Body, ASTNode *Parent, llvm::StringMap< AstPtr > &Partials, llvm::StringMap< Lambda > &Lambdas, llvm::StringMap< SectionLambda > &SectionLambdas, EscapeMap &Escapes)
 
bool hasTextBehind (size_t Idx, const ArrayRef< Token > &Tokens)
 
bool hasTextAhead (size_t Idx, const ArrayRef< Token > &Tokens)
 
bool requiresCleanUp (Token::Type T)
 
void stripTokenAhead (SmallVectorImpl< Token > &Tokens, size_t Idx)
 
void stripTokenBefore (SmallVectorImpl< Token > &Tokens, size_t Idx, Token &CurrentToken, Token::Type CurrentType)
 
SmallVector< Tokentokenize (StringRef Template)
 
void toMustacheString (const json::Value &Data, raw_ostream &OS)
 

Typedef Documentation

◆ AstPtr

using llvm::mustache::AstPtr = typedef std::unique_ptr<ASTNode>

Definition at line 87 of file Mustache.h.

◆ EscapeMap

using llvm::mustache::EscapeMap = typedef DenseMap<char, std::string>

Definition at line 119 of file Mustache.cpp.

◆ Lambda

using llvm::mustache::Lambda = typedef std::function<llvm::json::Value()>

Definition at line 83 of file Mustache.h.

◆ SectionLambda

using llvm::mustache::SectionLambda = typedef std::function<llvm::json::Value(std::string)>

Definition at line 84 of file Mustache.h.

Function Documentation

◆ createNode()

AstPtr llvm::mustache::createNode ( ASTNode::Type  T,
Accessor  A,
ASTNode Parent,
llvm::StringMap< AstPtr > &  Partials,
llvm::StringMap< Lambda > &  Lambdas,
llvm::StringMap< SectionLambda > &  SectionLambdas,
EscapeMap Escapes 
)

Definition at line 199 of file Mustache.cpp.

References A.

◆ createRootNode()

AstPtr llvm::mustache::createRootNode ( llvm::StringMap< AstPtr > &  Partials,
llvm::StringMap< Lambda > &  Lambdas,
llvm::StringMap< SectionLambda > &  SectionLambdas,
EscapeMap Escapes 
)

Definition at line 192 of file Mustache.cpp.

Referenced by llvm::mustache::Parser::parse().

◆ createTextNode()

AstPtr llvm::mustache::createTextNode ( std::string  Body,
ASTNode Parent,
llvm::StringMap< AstPtr > &  Partials,
llvm::StringMap< Lambda > &  Lambdas,
llvm::StringMap< SectionLambda > &  SectionLambdas,
EscapeMap Escapes 
)

Definition at line 208 of file Mustache.cpp.

◆ hasTextAhead()

bool llvm::mustache::hasTextAhead ( size_t  Idx,
const ArrayRef< Token > &  Tokens 
)

◆ hasTextBehind()

bool llvm::mustache::hasTextBehind ( size_t  Idx,
const ArrayRef< Token > &  Tokens 
)

◆ requiresCleanUp()

bool llvm::mustache::requiresCleanUp ( Token::Type  T)

◆ stripTokenAhead()

void llvm::mustache::stripTokenAhead ( SmallVectorImpl< Token > &  Tokens,
size_t  Idx 
)

◆ stripTokenBefore()

void llvm::mustache::stripTokenBefore ( SmallVectorImpl< Token > &  Tokens,
size_t  Idx,
Token CurrentToken,
Token::Type  CurrentType 
)

◆ tokenize()

SmallVector< Token > llvm::mustache::tokenize ( StringRef  Template)

◆ toMustacheString()

void llvm::mustache::toMustacheString ( const json::Value Data,
raw_ostream OS 
)