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

Use pre-whitespace position for source end locations #744

Merged

Conversation

expipiplus1
Copy link
Collaborator

@expipiplus1 expipiplus1 commented Oct 25, 2020

Fixes #743

I have not tested this extensively, so please consider this a WIP
I have tested this a little bit and it seems to work

Copy link
Collaborator

@layus layus left a comment

Choose a reason for hiding this comment

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

Looks okay to me. Nice work :-).

(But I do not have commit access sadly)

expipiplus1 added a commit to expipiplus1/hnix that referenced this pull request Oct 29, 2020
it is not generally appropriate to have higher-order parsers operate on
annotated locations as they are liable to perform changes to the parser which
are not captured in the annotation.

See haskell-nix#739 and
haskell-nix#744 for examples.
expipiplus1 added a commit to expipiplus1/hnix that referenced this pull request Oct 29, 2020
it is not generally appropriate to have higher-order parsers operate on
annotated locations as they are liable to perform changes to the parser which
are not captured in the annotation.

See haskell-nix#739 and
haskell-nix#744 for examples.
@expipiplus1
Copy link
Collaborator Author

Lol, can't believe it took me 4 years to come up with this. #35 (comment)

(I think back then it might have been hampered by using trifecta instead of megaparsec or something)

Anton-Latukha pushed a commit that referenced this pull request Oct 29, 2020
it is not generally appropriate to have higher-order parsers operate on
annotated locations as they are liable to perform changes to the parser which
are not captured in the annotation.

See #739 and
#744 for examples.
@expipiplus1
Copy link
Collaborator Author

Thanks @layus

@expipiplus1 expipiplus1 merged commit c0ed91f into haskell-nix:master Nov 1, 2020
@expipiplus1 expipiplus1 deleted the joe-sourcepos-whitespace branch November 1, 2020 03:46
Anton-Latukha pushed a commit that referenced this pull request May 22, 2021
Add small test for source locations

Relates to: #743 & #744
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.

Location annotation for expressions includes comments
2 participants