diff options
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 |
commit | deed8ec0ae23651529a58125012c1b4aab015d02 (patch) | |
tree | 51ca6d5948e92be37b9ee6674cb96801d2cd03f8 /include/openvic-dataloader/v2script | |
parent | 8b623bf4087aa360842ad31145d4ab6946cee9aa (diff) | |
parent | 1a694a8b26a441b12547057d6e0be61a111cced3 (diff) |
Merge pull request #49 from OpenVicProject/add/unit-testing
Add unit testing
Diffstat (limited to 'include/openvic-dataloader/v2script')
-rw-r--r-- | include/openvic-dataloader/v2script/AbstractSyntaxTree.hpp | 7 | ||||
-rw-r--r-- | include/openvic-dataloader/v2script/Parser.hpp | 6 |
2 files changed, 5 insertions, 8 deletions
diff --git a/include/openvic-dataloader/v2script/AbstractSyntaxTree.hpp b/include/openvic-dataloader/v2script/AbstractSyntaxTree.hpp index 29e7866..a582187 100644 --- a/include/openvic-dataloader/v2script/AbstractSyntaxTree.hpp +++ b/include/openvic-dataloader/v2script/AbstractSyntaxTree.hpp @@ -108,9 +108,7 @@ namespace ovdl::v2script::ast { struct ListValue : dryad::basic_node<NodeKind::ListValue, dryad::container_node<Value>> { explicit ListValue(dryad::node_ctor ctor, StatementList statements); explicit ListValue(dryad::node_ctor ctor, AssignStatementList statements); - - explicit ListValue(dryad::node_ctor ctor) : ListValue(ctor, StatementList {}) { - } + explicit ListValue(dryad::node_ctor ctor); DRYAD_CHILD_NODE_RANGE_GETTER(Statement, statements, nullptr, this->node_after(_last_statement)); @@ -167,8 +165,7 @@ namespace ovdl::v2script::ast { struct FileTree : dryad::basic_node<NodeKind::FileTree, dryad::container_node<Node>> { explicit FileTree(dryad::node_ctor ctor, StatementList statements); explicit FileTree(dryad::node_ctor ctor, AssignStatementList statements); - explicit FileTree(dryad::node_ctor ctor) : FileTree(ctor, StatementList {}) { - } + explicit FileTree(dryad::node_ctor ctor); DRYAD_CHILD_NODE_RANGE_GETTER(Statement, statements, nullptr, this->node_after(_last_node)); diff --git a/include/openvic-dataloader/v2script/Parser.hpp b/include/openvic-dataloader/v2script/Parser.hpp index 1f6b158..2518e61 100644 --- a/include/openvic-dataloader/v2script/Parser.hpp +++ b/include/openvic-dataloader/v2script/Parser.hpp @@ -33,9 +33,9 @@ namespace ovdl::v2script { static Parser from_file(const char* path, std::optional<detail::Encoding> encoding_fallback = std::nullopt); static Parser from_file(const std::filesystem::path& path, std::optional<detail::Encoding> encoding_fallback = std::nullopt); - constexpr Parser& load_from_buffer(const char* data, std::size_t size, std::optional<detail::Encoding> encoding_fallback = std::nullopt); - constexpr Parser& load_from_buffer(const char* start, const char* end, std::optional<detail::Encoding> encoding_fallback = std::nullopt); - constexpr Parser& load_from_string(const std::string_view string, std::optional<detail::Encoding> encoding_fallback = std::nullopt); + Parser& load_from_buffer(const char* data, std::size_t size, std::optional<detail::Encoding> encoding_fallback = std::nullopt); + Parser& load_from_buffer(const char* start, const char* end, std::optional<detail::Encoding> encoding_fallback = std::nullopt); + Parser& load_from_string(const std::string_view string, std::optional<detail::Encoding> encoding_fallback = std::nullopt); Parser& load_from_file(const char* path, std::optional<detail::Encoding> encoding_fallback = std::nullopt); Parser& load_from_file(const std::filesystem::path& path, std::optional<detail::Encoding> encoding_fallback = std::nullopt); |