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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix an inconsistency with ignorerepeated=true where we weren't #144

Merged
merged 1 commit into from
Oct 26, 2022

Conversation

quinnj
Copy link
Member

@quinnj quinnj commented Oct 26, 2022

setting the EOF code after matching repeated delimiters, as noticed by @nickrobinson251 here.

setting the EOF code after matching repeated delimiters, as noticed
by @nickrobinson251 [here](JuliaStrings/InlineStrings.jl#54 (comment)).
@codecov
Copy link

codecov bot commented Oct 26, 2022

Codecov Report

Base: 90.98% // Head: 90.99% // Increases project coverage by +0.01% 🎉

Coverage data is based on head (9b10767) compared to base (3136584).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #144      +/-   ##
==========================================
+ Coverage   90.98%   90.99%   +0.01%     
==========================================
  Files           9        9              
  Lines        1609     1611       +2     
==========================================
+ Hits         1464     1466       +2     
  Misses        145      145              
Impacted Files Coverage Δ
src/components.jl 99.17% <100.00%> (+<0.01%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@nickrobinson251 nickrobinson251 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so now we have:

with ignorerepeated===false

julia> Parsers.codes(Parsers.xparse(String, "a,").code)
"SUCCESS: OK | DELIMITED "

julia> Parsers.codes(Parsers.xparse(String, "a,\n").code)
"SUCCESS: OK | DELIMITED "

with ignorerepeated===true

julia> Parsers.codes(Parsers.xparse(String, "a,,"; ignorerepeated=true).code)
"SUCCESS: OK | DELIMITED | EOF "

julia> Parsers.codes(Parsers.xparse(String, "a,,\n"; ignorerepeated=true).code)
"SUCCESS: OK | DELIMITED | NEWLINE | EOF "

I think this makes the behaviour that's dependent on ignorerepeated be internally consistent, which is an improvement on the status quo
which was

julia> Parsers.codes(Parsers.xparse(String, "a,,"; ignorerepeated=true).code)
"SUCCESS: OK | DELIMITED "

julia> Parsers.codes(Parsers.xparse(String, "a,,\n"; ignorerepeated=true).code)
"SUCCESS: OK | DELIMITED | NEWLINE | EOF "

so on that basis i approve...

but i'm still not sure i'm fully convinced that behaviour should be so different between ignorerepeated===false and ignorerepeated===true.

since CSV.jl depends on it being this way, and it might be the right way even though i don't fully understand it, i think we can leave this as-is and potentially review again another time

@quinnj quinnj merged commit 45d6b2e into main Oct 26, 2022
@quinnj quinnj deleted the jq/eof_ignore_repeat_delim branch October 26, 2022 14:33
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