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(scanner): support multi-line variables #41

Merged
merged 3 commits into from
May 19, 2024

Conversation

jippi
Copy link
Owner

@jippi jippi commented May 19, 2024

Fixes #40

@jippi jippi self-assigned this May 19, 2024
@jippi
Copy link
Owner Author

jippi commented May 19, 2024

@intentionally-left-nil does this fix your use-case? :)

Copy link

codecov bot commented May 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.58%. Comparing base (ab39e27) to head (152aeeb).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #41      +/-   ##
==========================================
+ Coverage   68.54%   68.58%   +0.03%     
==========================================
  Files          66       66              
  Lines        3462     3466       +4     
==========================================
+ Hits         2373     2377       +4     
  Misses        959      959              
  Partials      130      130              

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

@intentionally-left-nil
Copy link

@jippi it does fix it 👍

although I'm a bit surprised you didn't need to fix the Token struct in order to account for multiline pieces. I didn't dig too deeply into the repository, but it might be worth fixing that, ripping out the Token length/offset fields, or having a new MultilineToken struct

@jippi
Copy link
Owner Author

jippi commented May 19, 2024

The token struct should be fine to point to the first line of a multi-line statement; its only used to provide useful feedback errors to end-users; so you would get the error line reference pointing to the line where the key= part is - which is the place you likely would want to jump to anyway.

The range itself isn't wouldn't really be used for anything.

Also, the parser keeps track of first/last line of a token; so it should be rolling it up nicely where applicable

@jippi jippi merged commit e691d14 into main May 19, 2024
9 checks passed
@jippi jippi deleted the add-support-for-multiline-vars branch May 19, 2024 19: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.

Dottie doesn't handle multiline variables
2 participants