diff --git a/include/openvic-dataloader/Error.hpp b/include/openvic-dataloader/Error.hpp index 48e0ec3..f78ea14 100644 --- a/include/openvic-dataloader/Error.hpp +++ b/include/openvic-dataloader/Error.hpp @@ -3,11 +3,11 @@ #include #include +#include #include #include #include -#include namespace ovdl { template @@ -51,12 +51,7 @@ namespace ovdl::error { LastAnnotation = SecondaryAnnotation, }; - struct ErrorSymbolInterner { - struct SymbolId; - using index_type = std::uint32_t; - using symbol_type = dryad::symbol; - using symbol_interner_type = dryad::symbol_interner; - }; + struct ErrorSymbolInterner : SymbolIntern {}; static constexpr std::string_view get_kind_name(ErrorKind kind) { switch (kind) { @@ -70,7 +65,7 @@ namespace ovdl::error { } struct Error : dryad::abstract_node_all { - const char* message(const ErrorSymbolInterner::symbol_interner_type& symbols) const { return _message.c_str(symbols); } + const char* message(const ErrorSymbolInterner::symbol_interner_type& symbols) const { return _message.c_str(); } protected: DRYAD_ABSTRACT_NODE_CTOR(Error); diff --git a/include/openvic-dataloader/csv/Parser.hpp b/include/openvic-dataloader/csv/Parser.hpp index e3ae84d..f6c2997 100644 --- a/include/openvic-dataloader/csv/Parser.hpp +++ b/include/openvic-dataloader/csv/Parser.hpp @@ -11,8 +11,6 @@ #include #include -#include - namespace ovdl::csv { class Parser final : public detail::BasicParser { public: diff --git a/include/openvic-dataloader/detail/ErrorRange.hpp b/include/openvic-dataloader/detail/ErrorRange.hpp index 7d5ca13..0ba1018 100644 --- a/include/openvic-dataloader/detail/ErrorRange.hpp +++ b/include/openvic-dataloader/detail/ErrorRange.hpp @@ -2,8 +2,6 @@ #include -#include - namespace ovdl::detail { template using error_range = decltype(std::declval()->errors()); diff --git a/include/openvic-dataloader/detail/HashAlgorithm.hpp b/include/openvic-dataloader/detail/HashAlgorithm.hpp new file mode 100644 index 0000000..513a25c --- /dev/null +++ b/include/openvic-dataloader/detail/HashAlgorithm.hpp @@ -0,0 +1,53 @@ +#pragma once + +#include +#include + +namespace ovdl::detail { + /// FNV-1a 64 bit hash. + class DefaultHash { + static constexpr std::uint64_t fnv_basis = 14695981039346656037ull; + static constexpr std::uint64_t fnv_prime = 1099511628211ull; + + public: + explicit DefaultHash() : _hash(fnv_basis) {} + + DefaultHash(DefaultHash&&) = default; + DefaultHash& operator=(DefaultHash&&) = default; + + ~DefaultHash() = default; + + DefaultHash&& hash_bytes(const unsigned char* ptr, std::size_t size) { + for (auto i = 0u; i != size; ++i) { + _hash ^= ptr[i]; + _hash *= fnv_prime; + } + return static_cast&&>(*this); + } + + template + requires std::is_scalar_v + DefaultHash&& hash_scalar(T value) { + static_assert(!std::is_floating_point_v, + "you shouldn't use floats as keys for a hash table"); + hash_bytes(reinterpret_cast(&value), sizeof(T)); + return static_cast&&>(*this); + } + + template + DefaultHash&& hash_c_str(const CharT* str) { + while (*str != '\0') { + hash_scalar(*str); + ++str; + } + return static_cast&&>(*this); + } + + std::uint64_t finish() && { + return _hash; + } + + private: + std::uint64_t _hash; + }; +} \ No newline at end of file diff --git a/include/openvic-dataloader/detail/HashTable.hpp b/include/openvic-dataloader/detail/HashTable.hpp new file mode 100644 index 0000000..244700a --- /dev/null +++ b/include/openvic-dataloader/detail/HashTable.hpp @@ -0,0 +1,263 @@ +#pragma once + +#include +#include +#include +#include +#include + +#include + +namespace ovdl::detail { + /// A simple hash table for trivial keys with linear probing. + /// It is non-owning as it does not store the used memory resource. + template + class HashTable { + public: + using value_type = typename Traits::value_type; + static_assert(std::is_trivial_v); + + constexpr HashTable() = default; + + template + void free(ResourcePtr resource) { + if (_table_capacity == 0) { + return; + } + + resource->deallocate(_table, _table_capacity * sizeof(value_type), alignof(value_type)); + _table = nullptr; + _table_size = 0; + _table_capacity = 0; + } + + struct entry_handle { + HashTable* _self; + value_type* _entry; + bool _valid; + + explicit operator bool() const { + return _valid; + } + + std::size_t index() const { + return std::size_t(_entry - _self->_table); + } + + value_type& get() const { + assert(*this); + return *_entry; + } + + void create(const value_type& value) { + assert(!*this); + *_entry = value; + ++_self->_table_size; + _valid = true; + } + + void remove() { + assert(*this); + Traits::fill_removed(_entry, 1); + --_self->_table_size; + _valid = false; + } + }; + + // Looks for an entry in the table, creating one if necessary. + // + // If it is already in the table, returns a pointer to its valid entry. + // + // Otherwise, locates a new entry for that value and returns a pointer to it which is currently + // invalid. Invariants of map are broken until the ptr has been written to. + template + entry_handle lookup_entry(const Key& key, Traits traits = {}) { + assert(_table_size < _table_capacity); + + auto hash = traits.hash(key); + auto table_idx = hash & (_table_capacity - 1); + + while (true) { + auto entry = _table + table_idx; + if (Traits::is_unoccupied(*entry)) { + // We found an empty entry, return it. + return { this, entry, false }; + } + + // Check whether the entry is the same string. + if (traits.is_equal(*entry, key)) { + // It is already in the table, return it. + return { this, entry, true }; + } + + // Go to next entry. + table_idx = (table_idx + 1) & (_table_capacity - 1); + } + } + template + value_type* lookup(const Key& key, Traits traits = {}) const { + if (_table_size == 0) { + return nullptr; + } + + auto entry = const_cast(this)->lookup_entry(key, traits); + return entry ? &entry.get() : nullptr; + } + + bool should_rehash() const { + return _table_size >= _table_capacity / 2; + } + + static constexpr std::size_t to_table_capacity(unsigned long long cap) { + if (cap < MinTableSize) { + return MinTableSize; + } + + // Round up to next power of two. + return std::size_t(1) << (int(sizeof(cap) * CHAR_BIT) - std::countl_zero(cap - 1)); + } + + template + void rehash( + ResourcePtr resource, std::size_t new_capacity, Traits traits = {}, + Callback entry_cb = +[](entry_handle, std::size_t) {}) { + assert(new_capacity == to_table_capacity(new_capacity)); + if (new_capacity <= _table_capacity) { + return; + } + + auto old_table = _table; + auto old_capacity = _table_capacity; + + // Allocate a bigger, currently empty table. + _table = static_cast( + resource->allocate(new_capacity * sizeof(value_type), alignof(value_type))); + _table_capacity = new_capacity; + Traits::fill_unoccupied(_table, _table_capacity); + + // Insert existing values into the new table. + if (_table_size > 0) { + _table_size = 0; + + for (auto entry = old_table; entry != old_table + old_capacity; ++entry) { + if (!Traits::is_unoccupied(*entry)) { + auto new_entry = lookup_entry(*entry, traits); + new_entry.create(*entry); + entry_cb(new_entry, std::size_t(entry - old_table)); + } + } + } + + if (old_capacity > 0) { + resource->deallocate(old_table, old_capacity * sizeof(value_type), alignof(value_type)); + } + } + template + void rehash( + ResourcePtr resource, Traits traits = {}, + Callback entry_cb = +[](entry_handle, std::size_t) {}) { + rehash(resource, to_table_capacity(2 * _table_capacity), traits, entry_cb); + } + + //=== access ===// + std::size_t size() const { + return _table_size; + } + std::size_t capacity() const { + return _table_capacity; + } + + struct entry_range { + struct iterator { + using value_type = std::remove_cv_t; + using reference = entry_handle; + struct pointer { + value_type value; + + constexpr value_type* operator->() noexcept { + return &value; + } + }; + using difference_type = std::ptrdiff_t; + using iterator_category = std::forward_iterator_tag; + + constexpr reference operator*() const noexcept { + return static_cast(*this).deref(); + } + constexpr pointer operator->() const noexcept { + return pointer { **this }; + } + + constexpr iterator& operator++() noexcept { + auto& derived = static_cast(*this); + derived.increment(); + return derived; + } + constexpr iterator operator++(int) noexcept { + auto& derived = static_cast(*this); + auto copy = derived; + derived.increment(); + return copy; + } + + friend constexpr bool operator==(const iterator& lhs, const iterator& rhs) { + return lhs.equal(rhs); + } + friend constexpr bool operator!=(const iterator& lhs, const iterator& rhs) { + return !lhs.equal(rhs); + } + + HashTable* _self; + HashTable::value_type* _cur; + + iterator() : _self(nullptr), _cur(nullptr) {} + explicit iterator(HashTable& self, HashTable::value_type* cur) + : _self(&self), _cur(cur) {} + + entry_handle deref() const { + return { _self, _cur, true }; + } + void increment() { + auto end = _self->_table + _self->_table_capacity; + do { + ++_cur; + } while (_cur != end && Traits::is_unoccupied(*_cur)); + } + bool equal(iterator rhs) const { + return _cur == rhs._cur; + } + }; + + iterator begin() const { + if (_self->size() == 0) { + return {}; + } + + auto cur = _self->_table; + while (Traits::is_unoccupied(*cur)) { + cur++; + } + return iterator(*_self, cur); + } + iterator end() const { + if (_self->size() == 0) { + return {}; + } + + return iterator(*_self, _self->_table + _self->_table_capacity); + } + + HashTable* _self; + }; + + /// Iterates over all occupied entries. + entry_range entries() { + return { this }; + } + + private: + value_type* _table = nullptr; + std::size_t _table_capacity = 0; // power of two + std::size_t _table_size = 0; + }; +} \ No newline at end of file diff --git a/include/openvic-dataloader/detail/MemoryResource.hpp b/include/openvic-dataloader/detail/MemoryResource.hpp new file mode 100644 index 0000000..aa81ac1 --- /dev/null +++ b/include/openvic-dataloader/detail/MemoryResource.hpp @@ -0,0 +1,115 @@ +#pragma once + +#include +#include +#include + +namespace ovdl::detail { + class DefaultMemoryResource { + public: + static void* allocate(std::size_t bytes, std::size_t alignment) { + if (alignment > __STDCPP_DEFAULT_NEW_ALIGNMENT__) { + return ::operator new(bytes, std::align_val_t { alignment }); + } else { + return ::operator new(bytes); + } + } + + static void deallocate(void* ptr, std::size_t bytes, std::size_t alignment) noexcept { +#ifdef __cpp_sized_deallocation + if (alignment > __STDCPP_DEFAULT_NEW_ALIGNMENT__) { + ::operator delete(ptr, bytes, std::align_val_t { alignment }); + } else { + ::operator delete(ptr, bytes); + } +#else + (void)bytes; + + if (alignment > __STDCPP_DEFAULT_NEW_ALIGNMENT__) { + ::operator delete(ptr, std::align_val_t { alignment }); + } else { + ::operator delete(ptr); + } +#endif + } + + friend constexpr bool operator==(DefaultMemoryResource, DefaultMemoryResource) noexcept { + return true; + } + }; + + template + class _MemoryResourcePtrEmpty { + public: + constexpr explicit _MemoryResourcePtrEmpty(MemoryResource*) noexcept {} + constexpr explicit _MemoryResourcePtrEmpty(void*) noexcept {} + + constexpr auto operator*() const noexcept { + return MemoryResource {}; + } + + constexpr auto operator->() const noexcept { + struct proxy { + MemoryResource _resource; + + constexpr MemoryResource* operator->() noexcept { + return &_resource; + } + }; + + return proxy {}; + } + + constexpr MemoryResource* get() const noexcept { + return nullptr; + } + }; + + template + class _MemoryResourcePtr { + public: + constexpr explicit _MemoryResourcePtr(MemoryResource* resource) noexcept : _resource(resource) { + LEXY_PRECONDITION(resource); + } + + constexpr MemoryResource& operator*() const noexcept { + return *_resource; + } + + constexpr MemoryResource* operator->() const noexcept { + return _resource; + } + + constexpr MemoryResource* get() const noexcept { + return _resource; + } + + private: + MemoryResource* _resource; + }; + + template + struct _MemoryResourcePtrSelector { + using type = _MemoryResourcePtr; + }; + + template + requires std::is_empty_v + struct _MemoryResourcePtrSelector { + using type = _MemoryResourcePtrEmpty; + }; + + template<> + struct _MemoryResourcePtrSelector { + using type = _MemoryResourcePtrEmpty; + }; + + template + using MemoryResourcePtr = _MemoryResourcePtrSelector::type; + + template + requires std::is_void_v || std::is_empty_v + constexpr MemoryResource* get_memory_resource() { + return nullptr; + } +} \ No newline at end of file diff --git a/include/openvic-dataloader/detail/SymbolIntern.hpp b/include/openvic-dataloader/detail/SymbolIntern.hpp index 9da428d..9776886 100644 --- a/include/openvic-dataloader/detail/SymbolIntern.hpp +++ b/include/openvic-dataloader/detail/SymbolIntern.hpp @@ -1,13 +1,18 @@ #pragma once +#include #include +#include #include #include +#include +#include +#include +#include +#include #include -#include - namespace ovdl { // Contains all unique symbols, null-terminated, in memory one after the other. template @@ -58,7 +63,7 @@ namespace ovdl { } const CharT* insert(const CharT* str, std::size_t length) { - DRYAD_PRECONDITION(_data_buffer.capacity() - _data_buffer.size() >= length + 1); + assert(_data_buffer.capacity() - _data_buffer.size() >= length + 1); auto index = _data_buffer.cend(); @@ -69,7 +74,7 @@ namespace ovdl { } const CharT* c_str(std::size_t index) const { - DRYAD_PRECONDITION(index < _data_buffer.size()); + assert(index < _data_buffer.size()); return _data_buffer.data() + index; } @@ -118,10 +123,10 @@ namespace ovdl { std::size_t hash(IndexType entry) const { auto str = buffer->c_str(entry); - return dryad::default_hash_algorithm().hash_c_str(str).finish(); + return detail::DefaultHash().hash_c_str(str).finish(); } static constexpr std::size_t hash(string_view str) { - return dryad::default_hash_algorithm() + return detail::DefaultHash() .hash_bytes(reinterpret_cast(str.ptr), str.length * sizeof(CharT)) .finish(); } @@ -136,17 +141,17 @@ namespace ovdl { static_assert(std::is_trivial_v); static_assert(std::is_unsigned_v); - using resource_ptr = dryad::_detail::memory_resource_ptr; + using resource_ptr = detail::MemoryResourcePtr; using traits = symbol_index_hash_traits; public: using symbol = ovdl::symbol; //=== construction ===// - constexpr symbol_interner() : _resource(dryad::_detail::get_memory_resource()) {} + constexpr symbol_interner() : _resource(detail::get_memory_resource()) {} constexpr explicit symbol_interner(std::size_t max_elements) : _buffer(max_elements), - _resource(dryad::_detail::get_memory_resource()) {} + _resource(detail::get_memory_resource()) {} constexpr explicit symbol_interner(std::size_t max_elements, MemoryResource* resource) : _buffer(max_elements), _resource(resource) {} @@ -163,9 +168,9 @@ namespace ovdl { } symbol_interner& operator=(symbol_interner&& other) noexcept { - dryad::_detail::swap(_buffer, other._buffer); - dryad::_detail::swap(_map, other._map); - dryad::_detail::swap(_resource, other._resource); + std::swap(_buffer, other._buffer); + std::swap(_map, other._map); + std::swap(_resource, other._resource); return *this; } @@ -190,7 +195,7 @@ namespace ovdl { } template symbol find_intern(const CharT (&literal)[N]) { - DRYAD_PRECONDITION(literal[N - 1] == CharT(0)); + assert(literal[N - 1] == CharT(0)); return find_intern(literal, N - 1); } @@ -212,7 +217,7 @@ namespace ovdl { auto begin = _buffer.insert(str, length); auto idx = std::distance(_buffer.c_str(0), begin); - DRYAD_PRECONDITION(idx == IndexType(idx)); // Overflow of index type. + assert(idx == IndexType(idx)); // Overflow of index type. // Store index in map. entry.create(IndexType(idx)); @@ -222,14 +227,14 @@ namespace ovdl { } template symbol intern(const CharT (&literal)[N]) { - DRYAD_PRECONDITION(literal[N - 1] == CharT(0)); + assert(literal[N - 1] == CharT(0)); return intern(literal, N - 1); } private: symbol_buffer _buffer; - dryad::_detail::hash_table _map; - DRYAD_EMPTY_MEMBER resource_ptr _resource; + detail::HashTable _map; + OVDL_NO_UNIQUE_ADDRESS resource_ptr _resource; friend symbol; }; diff --git a/include/openvic-dataloader/detail/Utility.hpp b/include/openvic-dataloader/detail/Utility.hpp index 3a9e170..06c74f3 100644 --- a/include/openvic-dataloader/detail/Utility.hpp +++ b/include/openvic-dataloader/detail/Utility.hpp @@ -7,6 +7,14 @@ #include +#if __has_cpp_attribute(msvc::no_unique_address) +#define OVDL_NO_UNIQUE_ADDRESS \ + _Pragma("warning(push)") _Pragma("warning(disable : 4848)") \ + [[msvc::no_unique_address]] _Pragma("warning(pop)") +#else +#define OVDL_NO_UNIQUE_ADDRESS [[no_unique_address]] +#endif + namespace ovdl::detail { [[noreturn]] inline void unreachable() { // Uses compiler specific extensions if possible. diff --git a/include/openvic-dataloader/v2script/AbstractSyntaxTree.hpp b/include/openvic-dataloader/v2script/AbstractSyntaxTree.hpp index 27ceb3d..24b0253 100644 --- a/include/openvic-dataloader/v2script/AbstractSyntaxTree.hpp +++ b/include/openvic-dataloader/v2script/AbstractSyntaxTree.hpp @@ -6,12 +6,8 @@ #include #include -#include -#include #include #include -#include -#include namespace ovdl::v2script::ast { enum class NodeKind { diff --git a/include/openvic-dataloader/v2script/Parser.hpp b/include/openvic-dataloader/v2script/Parser.hpp index e575dfc..5cff8be 100644 --- a/include/openvic-dataloader/v2script/Parser.hpp +++ b/include/openvic-dataloader/v2script/Parser.hpp @@ -16,8 +16,6 @@ #include #include -#include - namespace ovdl::v2script { using FileTree = ast::FileTree; using FilePosition = ovdl::FilePosition; diff --git a/src/openvic-dataloader/AbstractSyntaxTree.hpp b/src/openvic-dataloader/AbstractSyntaxTree.hpp index 156b7d0..eea99f8 100644 --- a/src/openvic-dataloader/AbstractSyntaxTree.hpp +++ b/src/openvic-dataloader/AbstractSyntaxTree.hpp @@ -12,9 +12,6 @@ #include -#include -#include -#include #include #include @@ -112,14 +109,14 @@ namespace ovdl { template T* create(NodeLocation loc, Args&&... args) { - auto node = _tree.template create(DRYAD_FWD(args)...); + auto node = _tree.template create(static_cast(args)...); set_location(node, loc); return node; } template T* create(const char* begin, const char* end, Args&&... args) { - return create(NodeLocation::make_from(begin, end), DRYAD_FWD(args)...); + return create(NodeLocation::make_from(begin, end), static_cast(args)...); } void set_root(root_node_type* node) { diff --git a/src/openvic-dataloader/DiagnosticLogger.hpp b/src/openvic-dataloader/DiagnosticLogger.hpp index 1de51bc..39ce32a 100644 --- a/src/openvic-dataloader/DiagnosticLogger.hpp +++ b/src/openvic-dataloader/DiagnosticLogger.hpp @@ -23,10 +23,6 @@ #include #include -#include -#include -#include -#include #include #include @@ -155,15 +151,15 @@ namespace ovdl { template T* create(BasicNodeLocation loc, Args&&... args) { - using node_creator = dryad::node_creator; - T* result = _tree.create(DRYAD_FWD(args)...); + using node_creator = dryad::node_creator().kind()), void>; + T* result = _tree.create(static_cast(args)...); _map.insert(result, loc); return result; } template T* create() { - using node_creator = dryad::node_creator; + using node_creator = dryad::node_creator().kind()), void>; T* result = _tree.create(); return result; } @@ -192,7 +188,7 @@ namespace ovdl { return intern(str.data(), str.size()); } const char* intern_cstr(const char* str, std::size_t length) { - return intern(str, length).c_str(_symbol_interner); + return intern(str, length).c_str(); } const char* intern_cstr(std::string_view str) { return intern_cstr(str.data(), str.size()); diff --git a/src/openvic-dataloader/ParseState.hpp b/src/openvic-dataloader/ParseState.hpp index 6d635ee..4288788 100644 --- a/src/openvic-dataloader/ParseState.hpp +++ b/src/openvic-dataloader/ParseState.hpp @@ -5,8 +5,6 @@ #include #include -#include - #include "DiagnosticLogger.hpp" #include "detail/InternalConcepts.hpp" diff --git a/src/openvic-dataloader/csv/Parser.cpp b/src/openvic-dataloader/csv/Parser.cpp index 25f7fbb..84bc06a 100644 --- a/src/openvic-dataloader/csv/Parser.cpp +++ b/src/openvic-dataloader/csv/Parser.cpp @@ -16,8 +16,6 @@ #include #include -#include - #include "CsvGrammar.hpp" #include "CsvParseState.hpp" #include "detail/NullBuff.hpp" diff --git a/src/openvic-dataloader/detail/InternalConcepts.hpp b/src/openvic-dataloader/detail/InternalConcepts.hpp index 06c03a1..c7ffbb3 100644 --- a/src/openvic-dataloader/detail/InternalConcepts.hpp +++ b/src/openvic-dataloader/detail/InternalConcepts.hpp @@ -11,8 +11,6 @@ #include #include -#include - #include #include @@ -62,12 +60,12 @@ namespace ovdl::detail { { ct.errored() } -> std::same_as; { ct.warned() } -> std::same_as; { ct.get_errors() } -> std::same_as; - { t.intern(str, length) } -> detail::InstanceOf; - { t.intern(sv) } -> detail::InstanceOf; + { t.intern(str, length) } -> detail::InstanceOf; + { t.intern(sv) } -> detail::InstanceOf; { t.intern_cstr(str, length) } -> std::same_as; { t.intern_cstr(sv) } -> std::same_as; - { t.symbol_interner() } -> detail::InstanceOf; - { ct.symbol_interner() } -> detail::InstanceOf; + { t.symbol_interner() } -> detail::InstanceOf; + { ct.symbol_interner() } -> detail::InstanceOf; { t.error(std::declval>()) } -> std::same_as; { t.warning(std::declval>()) } -> std::same_as; { t.note(std::declval>()) } -> std::same_as; diff --git a/src/openvic-dataloader/detail/dsl.hpp b/src/openvic-dataloader/detail/dsl.hpp index 79e93ed..a25d711 100644 --- a/src/openvic-dataloader/detail/dsl.hpp +++ b/src/openvic-dataloader/detail/dsl.hpp @@ -80,17 +80,17 @@ namespace ovdl::dsl { if constexpr (std::same_as, lexy::nullopt>) { return state.ast().template create(loc); } else { - return state.ast().template create(loc, DRYAD_FWD(arg)); + return state.ast().template create(loc, static_cast(arg)); } }, [](detail::IsParseState auto& state, ovdl::NodeLocation loc, auto&&... args) { - return state.ast().template create(loc, DRYAD_FWD(args)...); + return state.ast().template create(loc, static_cast(args)...); }); template constexpr auto construct_list = callback( [](detail::IsParseState auto& state, const char* begin, ListType&& arg, const char* end) { - return state.ast().template create(NodeLocation::make_from(begin, end), DRYAD_FWD(arg)); + return state.ast().template create(NodeLocation::make_from(begin, end), static_cast(arg)); }, [](detail::IsParseState auto& state, const char* begin, lexy::nullopt, const char* end) { return state.ast().template create(NodeLocation::make_from(begin, end)); @@ -105,7 +105,7 @@ namespace ovdl::dsl { template constexpr auto construct_list = callback( [](detail::IsParseState auto& state, const char* begin, ListType&& arg, const char* end) { - return state.ast().template create(NodeLocation::make_from(begin, end), DRYAD_FWD(arg)); + return state.ast().template create(NodeLocation::make_from(begin, end), static_cast(arg)); }, [](detail::IsParseState auto& state, const char* begin, lexy::nullopt, const char* end) { return state.ast().template create(NodeLocation::make_from(begin, end)); diff --git a/src/openvic-dataloader/v2script/ModifierGrammar.hpp b/src/openvic-dataloader/v2script/ModifierGrammar.hpp index 122a8c7..bb05ab7 100644 --- a/src/openvic-dataloader/v2script/ModifierGrammar.hpp +++ b/src/openvic-dataloader/v2script/ModifierGrammar.hpp @@ -5,9 +5,6 @@ #include #include -#include -#include - #include "openvic-dataloader/NodeLocation.hpp" #include "SimpleGrammar.hpp" diff --git a/src/openvic-dataloader/v2script/Parser.cpp b/src/openvic-dataloader/v2script/Parser.cpp index f8506cb..26e68bf 100644 --- a/src/openvic-dataloader/v2script/Parser.cpp +++ b/src/openvic-dataloader/v2script/Parser.cpp @@ -24,7 +24,6 @@ #include #include -#include #include #include