Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove EOL Options (rely on xparse correctly parsing up to the invalid delim) #28

Merged
merged 5 commits into from
Oct 21, 2021

Conversation

nickrobinson251
Copy link
Owner

Rebases #14 and adds some further clean up

Blocked until JuliaData/Parsers.jl#93 is resolved

Currently we handle lines rows with end-of-line (EOL) comments by changing the Options to have delim='/' (where / is the comment character), and then calling next_line to consume / move past the comment.

But we can instead relying on xparse to be robust to the presence of the comment, i.e. to correctly parse the value up until it hits the comment character. It seems this will also consume the rest of the line too (i.e. it parsers til it hits the newline). The result code from xparse will then be "INVALID: OK | NEWLINE | INVALID_DELIMITER ", so we just need to handle that (i.e. ignore it, rather than warning like we usually would) and everything should be fine... hopefully 馃槀

This simplifies the existing code, and should make changes like #23 simpler too.

quinnj and others added 4 commits October 20, 2021 16:59
I think we decided we didn't need this, right?
- this was needed when we were changing
  the delim to the comment character (`/`),
  and so wouldn't hit `newline` if there
  was a comment.
- now that we expect parsing to work
  even when there's an invalid character
  (the comment character `/`), parsing
  should still consume the whole line
  and hit the newline character.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants