LLVM 22.0.0git
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 = std::unique_ptr<ASTNode>

Definition at line 87 of file Mustache.h.

◆ EscapeMap

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

Definition at line 119 of file Mustache.cpp.

◆ Lambda

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

Definition at line 83 of file Mustache.h.

◆ SectionLambda

using llvm::mustache::SectionLambda = 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(), and T.

◆ 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()

◆ 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()

◆ toMustacheString()