Some repairs for md_parser and template engine.
This commit is contained in:
parent
8705859115
commit
22157169c0
14 changed files with 180 additions and 159 deletions
|
@ -1,14 +1,14 @@
|
|||
#pragma once
|
||||
|
||||
#include "File.h"
|
||||
|
||||
#include "TemplateNode.h"
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <filesystem>
|
||||
|
||||
class TemplateNode;
|
||||
class TemplateTextBody;
|
||||
|
||||
using Path = std::filesystem::path;
|
||||
|
||||
class TemplateFile
|
||||
{
|
||||
public:
|
||||
|
@ -27,27 +27,32 @@ public:
|
|||
void loadContent();
|
||||
|
||||
private:
|
||||
void onTextBodyFinished(std::string working_string = {});
|
||||
unsigned checkForStatement(const std::string& lineSection);
|
||||
|
||||
void processLine(const std::string& line);
|
||||
unsigned checkForExpression(const std::string& lineSection);
|
||||
|
||||
void onTextSpanFinished();
|
||||
|
||||
void onFoundStatement(const std::string& statement_string);
|
||||
|
||||
void onFoundExpression(const std::string& expression_string);
|
||||
|
||||
void onFoundBlock(const std::vector<std::string> args);
|
||||
|
||||
void onFoundEndBlock(const std::vector<std::string> args);
|
||||
|
||||
void onFoundExtends(const std::vector<std::string> args);
|
||||
|
||||
void onFoundExpression(const std::string& expression_string);
|
||||
void processLine(const std::string& line);
|
||||
|
||||
Path mPath;
|
||||
std::string mParentName;
|
||||
std::vector<std::string> mRawContent;
|
||||
bool mHasLoaded{false};
|
||||
|
||||
unsigned mWorkingLine{ 0 };
|
||||
std::unique_ptr<TemplateNode> mRootNode;
|
||||
TemplateNode* mWorkingNode{ nullptr };
|
||||
std::unique_ptr<TemplateTextBody> mWorkingTextBody;
|
||||
|
||||
std::string mWorkingLineContent;
|
||||
std::unique_ptr<TemplateTextBody> mWorkingTextSpan;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue