From a07c64148eb60b886f92caa46a9c687240ec420c Mon Sep 17 00:00:00 2001 From: Spartan322 Date: Sat, 20 Jul 2024 21:02:30 -0400 Subject: Add backslash identifier support to v2script Add buffer::char_type size multiplier to max file size of string intern buffer Fix list grammar segfaults Fix diagnostic logger intern segfaults from buffer reallocation Fix non-string-supported CSV parser not supporting Victoria 2 CSV escaping behavior --- src/openvic-dataloader/AbstractSyntaxTree.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/openvic-dataloader/AbstractSyntaxTree.hpp') diff --git a/src/openvic-dataloader/AbstractSyntaxTree.hpp b/src/openvic-dataloader/AbstractSyntaxTree.hpp index ade1c82..f9f5796 100644 --- a/src/openvic-dataloader/AbstractSyntaxTree.hpp +++ b/src/openvic-dataloader/AbstractSyntaxTree.hpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include @@ -51,12 +52,12 @@ namespace ovdl { using node_type = typename file_type::node_type; explicit BasicAbstractSyntaxTree(file_type&& file) - : AbstractSyntaxTree(file.size()), + : AbstractSyntaxTree(file.size() * file.visit_buffer([](auto&& buffer) -> size_t { return sizeof(typename std::decay_t::char_type); })), _file { std::move(file) } {} template explicit BasicAbstractSyntaxTree(lexy::buffer&& buffer) - : AbstractSyntaxTree(buffer.size()), + : AbstractSyntaxTree(buffer.size() * sizeof(Encoding::char_type)), _file { std::move(buffer) } {} void set_location(const node_type* n, NodeLocation loc) { -- cgit v1.2.3-56-ga3b1