refactored ast, started lexer
This commit is contained in:
@@ -3,18 +3,12 @@
|
||||
#include "ast/BlockNode/BlockNode.h"
|
||||
#include "ast/InlineNode/InlineNode.h"
|
||||
|
||||
struct Header : public BlockNode {
|
||||
int level = 1;
|
||||
std::vector<std::unique_ptr<InlineNode>> children;
|
||||
namespace ast {
|
||||
struct Header : public BlockNode {
|
||||
int level = 1;
|
||||
std::vector<std::unique_ptr<InlineNode>> children;
|
||||
|
||||
NodeKind getKind() const override {
|
||||
return NodeKind::Header;
|
||||
}
|
||||
|
||||
void repr(std::ostream &os, int indent = 0) const override {
|
||||
os << getIndent(indent) << toString(this->getKind()) << " level: " << this->level << '\n';
|
||||
for (const std::unique_ptr<InlineNode> &child : this->children) {
|
||||
child->repr(os, indent + 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
NodeKind getKind() const override;
|
||||
void repr(std::ostream &os, int indent = 0) const override;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user