LLVM 22.0.0git
llvm::mustache Namespace Reference

Classes

class  AddIndentationStringStream
class  ASTNode
class  EscapeStringStream
struct  MustacheContext
class  MustacheOutputStream
class  Parser
class  RawMustacheOutputStream
struct  Tag
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

static AstPtr createRootNode (MustacheContext &Ctx)
static AstPtr createNode (MustacheContext &Ctx, ASTNode::Type T, Accessor A, ASTNode *Parent)
static AstPtr createTextNode (MustacheContext &Ctx, std::string Body, ASTNode *Parent)
static bool hasTextBehind (size_t Idx, const ArrayRef< Token > &Tokens)
static bool hasTextAhead (size_t Idx, const ArrayRef< Token > &Tokens)
static bool requiresCleanUp (Token::Type T)
static void stripTokenAhead (SmallVectorImpl< Token > &Tokens, size_t Idx)
void stripTokenBefore (SmallVectorImpl< Token > &Tokens, size_t Idx, Token &CurrentToken, Token::Type CurrentType)
static const chartagKindToString (Tag::Kind K)
static const charjsonKindToString (json::Value::Kind K)
static Tag findNextTag (StringRef Template, size_t StartPos, StringRef Open, StringRef Close)
static std::optional< std::pair< StringRef, StringRef > > processTag (const Tag &T, SmallVectorImpl< Token > &Tokens)
static SmallVector< Tokentokenize (StringRef Template)
static 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

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

Definition at line 88 of file Mustache.h.

◆ 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 ( MustacheContext & Ctx,
ASTNode::Type T,
Accessor A,
ASTNode * Parent )
static

Definition at line 229 of file Mustache.cpp.

References A(), and T.

◆ createRootNode()

AstPtr llvm::mustache::createRootNode ( MustacheContext & Ctx)
static

Definition at line 225 of file Mustache.cpp.

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

◆ createTextNode()

AstPtr llvm::mustache::createTextNode ( MustacheContext & Ctx,
std::string Body,
ASTNode * Parent )
static

Definition at line 234 of file Mustache.cpp.

◆ findNextTag()

Tag llvm::mustache::findNextTag ( StringRef Template,
size_t StartPos,
StringRef Open,
StringRef Close )
static

◆ hasTextAhead()

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

◆ hasTextBehind()

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

◆ jsonKindToString()

◆ processTag()

◆ requiresCleanUp()

◆ stripTokenAhead()

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

◆ stripTokenBefore()

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

◆ tagKindToString()

const char * llvm::mustache::tagKindToString ( Tag::Kind K)
static

◆ tokenize()

◆ toMustacheString()