Issues with Many parser when reading from file. #260
Unanswered
lukeredpath
asked this question in
Q&A
Replies: 1 comment 1 reply
-
It looks like an extra new line was getting inserted into the file - I solved this by trimming the string of new lines and whitespace when reading it from the file, before I pass it into the parser. Pretty weird though. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm running into an issue when running a parser against input from a file. I'm using swift-parsing for this years Advent Of Code, as I did last year, but last year I configured my input in swift files using a string. This year I'm reading them from plain text files and every single parser I write for what should be a trivial "parse many of this on each line" kind of parser fails when reading from a file, but not with sample data.
For example given this example input:
I can successfully parse this with:
However, when I run this on my input file, it fails with:
My only workaround so far is to wrap the many parser like this, but it feels like it shouldn't be necessary:
Beta Was this translation helpful? Give feedback.
All reactions