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

[NFC] Add more comments #8

Merged
merged 5 commits into from
Nov 22, 2023
Merged

[NFC] Add more comments #8

merged 5 commits into from
Nov 22, 2023

Conversation

Drvi
Copy link
Collaborator

@Drvi Drvi commented Nov 12, 2023

No description provided.

Copy link

codecov bot commented Nov 12, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e1bfb0c) 90.78% compared to head (e9327b9) 90.78%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main       #8   +/-   ##
=======================================
  Coverage   90.78%   90.78%           
=======================================
  Files           1        1           
  Lines         228      228           
=======================================
  Hits          207      207           
  Misses         21       21           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Drvi Drvi changed the title Add more comments [NFC] Add more comments Nov 13, 2023
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.

Looks great from what i've reviewed so far

i want to try to understand the details of the algorithms a bit better with the help of the new examples

src/NewlineLexers.jl Outdated Show resolved Hide resolved
src/NewlineLexers.jl Outdated Show resolved Hide resolved
src/NewlineLexers.jl Show resolved Hide resolved
src/NewlineLexers.jl Show resolved Hide resolved
src/NewlineLexers.jl Outdated Show resolved Hide resolved
@@ -429,22 +503,32 @@ function _find_newlines_quote_unaware_simd!(l::Lexer, buf::Vector{UInt8}, out::A
end
end

"""
find_newlines!(l::Lexer, buf::Vector{UInt8}, out::AbstractVector{Int32}, curr_pos::Int=firstindex(buf), end_pos::Int=lastindex(buf))
Copy link
Collaborator

Choose a reason for hiding this comment

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

it would be idiomatic for the argument being mutated out to be the first argument.

Is there a reason to break from that idiom?

Can we open an issue to change to that, so we have

find_newlines!(out::AbstractVector{Int32}, l::Lexer, buf::Vector{UInt8}, curr_pos::Int=firstindex(buf), end_pos::Int=lastindex(buf))

?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think you are right, but it does feel weird to me that the thing that impacts the implementation the most and that also gets mutated internally comes second... In an OO language, this would be Lexer.find_newlines(...), I think this is what throws me off.

src/NewlineLexers.jl Show resolved Hide resolved
src/NewlineLexers.jl Show resolved Hide resolved
@nickrobinson251 nickrobinson251 merged commit a297b35 into main Nov 22, 2023
15 checks passed
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.

2 participants