Skip to content

let SourcePos include start and end in characters #31

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

Open
Neppord opened this issue Feb 13, 2022 · 3 comments
Open

let SourcePos include start and end in characters #31

Neppord opened this issue Feb 13, 2022 · 3 comments

Comments

@Neppord
Copy link

Neppord commented Feb 13, 2022

line numbers and column positions are great for humans. I find that when indexing source code for automatic editing its easier to interface with the file or string using index.

Is this within the scope of this project?

@natefaubion
Copy link
Owner

I think it would be valuable to track index by code unit. The positions now are line/col by code point. I'm not sure anyone wants index by code point.

@Neppord
Copy link
Author

Neppord commented Feb 13, 2022 via email

@natefaubion
Copy link
Owner

I think it would be fine to add an index/offset field to
https://github.com/natefaubion/purescript-language-cst-parser/blob/main/src/PureScript/CST/Types.purs#L18-L21

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

No branches or pull requests

2 participants