Open dave-doty opened 1 month ago
I tried reverting to Pest 2.5 as in this project's Cargo.toml, but that has the same error. I'm curious if anyone has actually gotten this example to run successfully.
I got it to work by adding an extra newline after the final CSV record:
let source = "\
65279,1179403647,1463895090
3.1415927,2.7182817,1.618034
-40,-273.15
13,42
65537
";
But there is no terminating newline in the example CSV file, so it seems like either that should be fixed in that file. It also just seems like an error in the parser that it requires a newline at the end of the file.
It would also be nice if the example showed how to ignore whitespace, since that's such a common thing for so many file formats.
I think that example https://github.com/pest-parser/ast/blob/master/examples/csv.pest was taken from the book https://github.com/pest-parser/book/blob/master/src/examples/csv.md where it exhibits the same behavior. So if it's fixed, it'd be good to fix in both places.
I tried the csv example in the examples directory. The only thing I changed is to inline the grammar and the csv file content directly into the
csv.rs
file, but otherwise below is identical to what's in the examples directory:Running it results in this error: