Skip to content

Commit

Permalink
Move ast to dryad
Browse files Browse the repository at this point in the history
  • Loading branch information
Spartan322 committed Nov 29, 2023
1 parent 9a10a81 commit 9c9dec8
Show file tree
Hide file tree
Showing 31 changed files with 999 additions and 1,434 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,17 @@ jobs:
python -m pip install scons
scons --version
- name: macOS dependencies
if: ${{ matrix.platform == 'macos' }}
run: |
clang++ --version
echo 'export PATH="/usr/local/opt/llvm@15/bin:$PATH"' >> /Users/runner/.bash_profile
- name: macOS dependencies 2
if: ${{ matrix.platform == 'macos' }}
run: |
clang++ --version
- name: Linux dependencies
if: ${{ matrix.platform == 'linux' }}
run: |
Expand Down
4 changes: 2 additions & 2 deletions include/openvic-dataloader/ParseState.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ namespace ovdl {
using diagnostic_logger_type = BasicDiagnosticLogger<file_type>;

FileParseState(file_type&& file, std::ostream& error_stream)
: _file { file },
_logger { file(), error_stream } {}
: _file { std::move(file) },
_logger { file, error_stream } {}

FileParseState(lexy::buffer<typename file_type::encoding_type>&& buffer, std::ostream& error_stream)
: FileParseState(file_type { std::move(buffer) }, error_stream) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@

#include <openvic-dataloader/ParseError.hpp>
#include <openvic-dataloader/ParseWarning.hpp>
#include <openvic-dataloader/detail/utility/Concepts.hpp>

namespace ovdl::detail {
class BasicParser {
public:
struct BasicParser {
BasicParser();

void set_error_log_to_null();
Expand Down
9 changes: 4 additions & 5 deletions include/openvic-dataloader/csv/Parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

#include <filesystem>

#include <openvic-dataloader/Parser.hpp>
#include <openvic-dataloader/csv/LineObject.hpp>
#include <openvic-dataloader/detail/utility/Concepts.hpp>

#include "openvic-dataloader/detail/BasicParser.hpp"

namespace ovdl::csv {
enum class EncodingType {
Windows1252,
Expand Down Expand Up @@ -44,12 +43,12 @@ namespace ovdl::csv {
~Parser();

private:
class BufferHandler;
std::unique_ptr<BufferHandler> _buffer_handler;
class ParseHandler;
std::unique_ptr<ParseHandler> _buffer_handler;
std::vector<csv::LineObject> _lines;

template<typename... Args>
constexpr void _run_load_func(detail::LoadCallback<BufferHandler, Args...> auto func, Args... args);
constexpr void _run_load_func(detail::LoadCallback<ParseHandler, Args...> auto func, Args... args);
};

using Windows1252Parser = Parser<EncodingType::Windows1252>;
Expand Down
9 changes: 0 additions & 9 deletions include/openvic-dataloader/detail/OptionalConstexpr.hpp

This file was deleted.

9 changes: 0 additions & 9 deletions include/openvic-dataloader/detail/VectorConstexpr.hpp

This file was deleted.

6 changes: 2 additions & 4 deletions include/openvic-dataloader/detail/utility/Concepts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
#include <concepts>
#include <cstdint>
#include <functional>
#include <optional>
#include <utility>
#include "openvic-dataloader/ParseError.hpp"

namespace ovdl {
struct NodeLocation;
Expand All @@ -26,14 +24,14 @@ namespace ovdl::detail {
};

template<typename T>
concept HasPath = requires(const T* t) {
concept HasPath = requires(T* t) {
{ t->path() } -> std::convertible_to<const char*>;
};

template<typename T, typename Self, typename... Args>
concept LoadCallback =
requires(T&& t, Self&& self, Args&&... args) {
{ std::invoke(std::forward<T>(t), std::forward<Self>(self), std::forward<Args>(args)...) } -> std::same_as<std::optional<ParseError>>;
{ std::invoke(std::forward<T>(t), std::forward<Self>(self), std::forward<Args>(args)...) } -> std::same_as<ovdl::detail::buffer_error>;
};

template<typename T>
Expand Down
Loading

0 comments on commit 9c9dec8

Please sign in to comment.