diff options
author | Spartan322 <Megacake1234@gmail.com> | 2023-10-20 22:39:26 +0200 |
---|---|---|
committer | Spartan322 <Megacake1234@gmail.com> | 2023-10-20 22:39:26 +0200 |
commit | 7d5d86e44ebbd907c690023b4546a0ae0a37de3a (patch) | |
tree | 5ae26ce32e536a9e0ca281785b297d014e66179d /include/openvic-dataloader | |
parent | 0e3640b670932a597a8430588bd8ea3302126aab (diff) |
Add grammar support for BEL, HT, LF, and CR characters
Add stripping of LF and CR characters if `v2script::grammar::StringExpression`'s `Options::NoStringEscape` is false
Diffstat (limited to 'include/openvic-dataloader')
-rw-r--r-- | include/openvic-dataloader/v2script/AbstractSyntaxTree.hpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/include/openvic-dataloader/v2script/AbstractSyntaxTree.hpp b/include/openvic-dataloader/v2script/AbstractSyntaxTree.hpp index 8ff910f..32e7e42 100644 --- a/include/openvic-dataloader/v2script/AbstractSyntaxTree.hpp +++ b/include/openvic-dataloader/v2script/AbstractSyntaxTree.hpp @@ -166,9 +166,9 @@ namespace ovdl::v2script::ast { struct AbstractStringNode : public Node { std::string _name; AbstractStringNode(); - AbstractStringNode(std::string&& name); + AbstractStringNode(std::string&& name, bool allow_newline); AbstractStringNode(NodeLocation location); - AbstractStringNode(NodeLocation location, std::string&& name); + AbstractStringNode(NodeLocation location, std::string&& name, bool allow_newline); OVDL_TYPE_DEFINE_SELF; OVDL_RT_TYPE_DEF; OVDL_PRINT_FUNC_DEF; @@ -176,17 +176,17 @@ namespace ovdl::v2script::ast { constexpr std::string_view get_base_type() const override { return ::ovdl::detail::type_name<std::decay_t<decltype(*this)>>(); } }; -#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; \ +#define OVDL_AST_STRING_NODE(NAME) \ + struct NAME final : public AbstractStringNode { \ + NAME(); \ + NAME(std::string&& name, bool allow_newline = true); \ + NAME(lexy::nullopt); \ + NAME(NodeLocation location); \ + NAME(NodeLocation location, std::string&& name, bool allow_newline = true); \ + NAME(NodeLocation location, lexy::nullopt); \ + OVDL_TYPE_DEFINE_SELF; \ + OVDL_RT_TYPE_DEF; \ + OVDL_PRINT_FUNC_DEF; \ } // Value Expression Nodes |