From 8cd7b25b3eb87efdf56e5f87de928b93ed4fb2ed Mon Sep 17 00:00:00 2001 From: hop311 Date: Sun, 10 Dec 2023 22:34:37 +0000 Subject: Fix early termination on newline in CSV file --- src/openvic-dataloader/csv/CsvGrammar.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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 struct File { - static constexpr auto rule = - lexy::dsl::whitespace(lexy::dsl::newline) + - lexy::dsl::opt(lexy::dsl::list(lexy::dsl::p>, lexy::dsl::trailing_sep(lexy::dsl::eol))); + static constexpr auto rule = lexy::dsl::terminator(lexy::dsl::eof).opt_list( + lexy::dsl::p> | lexy::dsl::newline + ); static constexpr auto value = lexy::as_list>; }; -- cgit v1.2.3-56-ga3b1