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 = ASTNode *
using EscapeMap = DenseMap<char, std::string>
using ASTNodeList = iplist<ASTNode>

Functions

static AstPtr createRootNode (MustacheContext &Ctx)
static AstPtr createNode (MustacheContext &Ctx, ASTNode::Type T, ArrayRef< StringRef > A, ASTNode *Parent)
static AstPtr createTextNode (MustacheContext &Ctx, StringRef 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, MustacheContext &Ctx)
static SmallVector< Tokentokenize (StringRef Template, MustacheContext &Ctx)
static void toMustacheString (const json::Value &Data, raw_ostream &OS)

Typedef Documentation

◆ ASTNodeList

Definition at line 91 of file Mustache.h.

◆ AstPtr

Definition at line 89 of file Mustache.h.

◆ EscapeMap

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

Definition at line 90 of file Mustache.h.

◆ Lambda

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

Definition at line 85 of file Mustache.h.

◆ SectionLambda

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

Definition at line 86 of file Mustache.h.

Function Documentation

◆ createNode()

AstPtr llvm::mustache::createNode ( MustacheContext & Ctx,
ASTNode::Type T,
ArrayRef< StringRef > A,
ASTNode * Parent )
static

Definition at line 238 of file Mustache.cpp.

References A(), and T.

◆ createRootNode()

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

Definition at line 234 of file Mustache.cpp.

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

◆ createTextNode()

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

Definition at line 243 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()