Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions llvm/include/llvm/Support/Mustache.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ using SectionLambda = std::function<llvm::json::Value(std::string)>;

class ASTNode;
using AstPtr = std::unique_ptr<ASTNode>;
using EscapeMap = DenseMap<char, std::string>;

struct MustacheContext {
StringMap<AstPtr> Partials;
StringMap<Lambda> Lambdas;
StringMap<SectionLambda> SectionLambdas;
EscapeMap Escapes;
};

// A Template represents the container for the AST and the partials
// and Lambdas that are registered with it.
Expand Down Expand Up @@ -118,10 +126,7 @@ class Template {
LLVM_ABI void overrideEscapeCharacters(DenseMap<char, std::string> Escapes);

private:
StringMap<AstPtr> Partials;
StringMap<Lambda> Lambdas;
StringMap<SectionLambda> SectionLambdas;
DenseMap<char, std::string> Escapes;
MustacheContext Ctx;
AstPtr Tree;
};
} // namespace llvm::mustache
Expand Down
Loading
Loading