diff options
author | George L. Albany <Megacake1234@gmail.com> | 2023-10-05 01:38:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-05 01:38:17 +0200 |
commit | 4009e1d576ad177aff59c8fce0339963303fc6e5 (patch) | |
tree | 4456832acce290261f5839a083018afbd154ba16 /include | |
parent | 02c30fdda7b775782af1163b2321e7d6fcf01fcc (diff) | |
parent | 7b1e33c26b4d36be2e3d1292dc539ff17e358589 (diff) |
Merge pull request #22 from OpenVicProject/add/v2script-optional-content
Diffstat (limited to 'include')
-rw-r--r-- | include/openvic-dataloader/v2script/AbstractSyntaxTree.hpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/openvic-dataloader/v2script/AbstractSyntaxTree.hpp b/include/openvic-dataloader/v2script/AbstractSyntaxTree.hpp index 8e39bd9..8ff910f 100644 --- a/include/openvic-dataloader/v2script/AbstractSyntaxTree.hpp +++ b/include/openvic-dataloader/v2script/AbstractSyntaxTree.hpp @@ -14,6 +14,10 @@ #include <openvic-dataloader/detail/SelfType.hpp> #include <openvic-dataloader/detail/TypeName.hpp> +namespace lexy { + struct nullopt; +} + namespace ovdl::v2script { class Parser; } @@ -161,7 +165,9 @@ namespace ovdl::v2script::ast { struct AbstractStringNode : public Node { std::string _name; + AbstractStringNode(); AbstractStringNode(std::string&& name); + AbstractStringNode(NodeLocation location); AbstractStringNode(NodeLocation location, std::string&& name); OVDL_TYPE_DEFINE_SELF; OVDL_RT_TYPE_DEF; @@ -172,8 +178,12 @@ namespace ovdl::v2script::ast { #define OVDL_AST_STRING_NODE(NAME) \ struct NAME final : public AbstractStringNode { \ + NAME(); \ NAME(std::string&& name); \ + NAME(lexy::nullopt); \ + NAME(NodeLocation location); \ NAME(NodeLocation location, std::string&& name); \ + NAME(NodeLocation location, lexy::nullopt); \ OVDL_TYPE_DEFINE_SELF; \ OVDL_RT_TYPE_DEF; \ OVDL_PRINT_FUNC_DEF; \ @@ -219,7 +229,9 @@ namespace ovdl::v2script::ast { #define OVDL_AST_LIST_NODE(NAME) \ struct NAME final : public AbstractListNode { \ NAME(const std::vector<NodePtr>& statements = std::vector<NodePtr> {}); \ + NAME(lexy::nullopt); \ NAME(NodeLocation location, const std::vector<NodePtr>& statements = std::vector<NodePtr> {}); \ + NAME(NodeLocation location, lexy::nullopt); \ OVDL_TYPE_DEFINE_SELF; \ OVDL_RT_TYPE_DEF; \ OVDL_PRINT_FUNC_DEF; \ |