diff options
author | hop311 <hop3114@gmail.com> | 2023-12-10 23:34:37 +0100 |
---|---|---|
committer | hop311 <hop3114@gmail.com> | 2023-12-10 23:34:37 +0100 |
commit | 8cd7b25b3eb87efdf56e5f87de928b93ed4fb2ed (patch) | |
tree | 6bc17cfd188c7e18b8e3a51fc07e3d8071d360f6 /src | |
parent | ce1f1e5fe32ed0856bd2b6df5136dad3f6bc9918 (diff) |
Fix early termination on newline in CSV file
Diffstat (limited to 'src')
-rw-r--r-- | src/openvic-dataloader/csv/CsvGrammar.hpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/openvic-dataloader/csv/CsvGrammar.hpp b/src/openvic-dataloader/csv/CsvGrammar.hpp index aef513b..712bddc 100644 --- a/src/openvic-dataloader/csv/CsvGrammar.hpp +++ b/src/openvic-dataloader/csv/CsvGrammar.hpp @@ -165,9 +165,9 @@ namespace ovdl::csv::grammar { template<ParseOptions Options> struct File { - static constexpr auto rule = - lexy::dsl::whitespace(lexy::dsl::newline) + - lexy::dsl::opt(lexy::dsl::list(lexy::dsl::p<Line<Options>>, lexy::dsl::trailing_sep(lexy::dsl::eol))); + static constexpr auto rule = lexy::dsl::terminator(lexy::dsl::eof).opt_list( + lexy::dsl::p<Line<Options>> | lexy::dsl::newline + ); static constexpr auto value = lexy::as_list<std::vector<ovdl::csv::LineObject>>; }; |