aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-dataloader/v2script/AbstractSyntaxTree.cpp
diff options
context:
space:
mode:
author George L. Albany <Megacake1234@gmail.com>2024-06-22 21:58:35 +0200
committer GitHub <noreply@github.com>2024-06-22 21:58:35 +0200
commitdeed8ec0ae23651529a58125012c1b4aab015d02 (patch)
tree51ca6d5948e92be37b9ee6674cb96801d2cd03f8 /src/openvic-dataloader/v2script/AbstractSyntaxTree.cpp
parent8b623bf4087aa360842ad31145d4ab6946cee9aa (diff)
parent1a694a8b26a441b12547057d6e0be61a111cced3 (diff)
Merge pull request #49 from OpenVicProject/add/unit-testing
Add unit testing
Diffstat (limited to 'src/openvic-dataloader/v2script/AbstractSyntaxTree.cpp')
-rw-r--r--src/openvic-dataloader/v2script/AbstractSyntaxTree.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/openvic-dataloader/v2script/AbstractSyntaxTree.cpp b/src/openvic-dataloader/v2script/AbstractSyntaxTree.cpp
index 5a98b40..71985f3 100644
--- a/src/openvic-dataloader/v2script/AbstractSyntaxTree.cpp
+++ b/src/openvic-dataloader/v2script/AbstractSyntaxTree.cpp
@@ -1,4 +1,4 @@
-#include "openvic-dataloader/v2script/AbstractSyntaxTree.hpp"
+#include <openvic-dataloader/v2script/AbstractSyntaxTree.hpp>
#include <lexy/dsl/option.hpp>
#include <lexy/encoding.hpp>
@@ -31,6 +31,10 @@ ListValue::ListValue(dryad::node_ctor ctor, AssignStatementList statements) : no
}
}
+ListValue::ListValue(dryad::node_ctor ctor) : node_base(ctor) {
+ _last_statement = nullptr;
+}
+
FileTree::FileTree(dryad::node_ctor ctor, StatementList statements) : node_base(ctor) {
insert_child_list_after(nullptr, statements);
if (statements.empty()) {
@@ -49,6 +53,10 @@ FileTree::FileTree(dryad::node_ctor ctor, AssignStatementList statements) : node
}
}
+FileTree::FileTree(dryad::node_ctor ctor) : node_base(ctor) {
+ _last_node = nullptr;
+}
+
std::string FileAbstractSyntaxTree::make_list_visualizer() const {
const int INDENT_SIZE = 2;