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

scanner: fix position calculation for literal, folded and raw folded strings #330

Merged
merged 1 commit into from Dec 19, 2022

Conversation

efd6
Copy link
Contributor

@efd6 efd6 commented Dec 11, 2022

The approach to calculating the column is not ideal from an allocations perpective, but is similar to other calculations in the code base that do a temporary []runestring conversion. I would prefer to retain an offset field instead, but that is a more invasive change.

The setting of token.Position.IndentNum is left as is since it's not clear to me what that is there for; the field is never read in the code base and so is apparently not used internally (removal does not affect tests, though external client code may be using it for something).

Fixes #326.

Please take a look.

@codecov-commenter
Copy link

Codecov Report

Merging #330 (358b0ba) into master (dc3fed8) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #330   +/-   ##
=======================================
  Coverage   75.63%   75.63%           
=======================================
  Files          13       13           
  Lines        4359     4359           
=======================================
  Hits         3297     3297           
  Misses        819      819           
  Partials      243      243           

@goccy
Copy link
Owner

goccy commented Dec 19, 2022

Thank you for your great PR !!! LGTM

@goccy goccy merged commit 13b070a into goccy:master Dec 19, 2022
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.

comments are not properly preserved following folded/literal string
3 participants