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

Implement the support for location metadata in the text buffer #904

Open
5 tasks
desaikd opened this issue Feb 5, 2025 · 0 comments
Open
5 tasks

Implement the support for location metadata in the text buffer #904

desaikd opened this issue Feb 5, 2025 · 0 comments

Comments

@desaikd
Copy link
Contributor

desaikd commented Feb 5, 2025

Location metadata here means row and column values for the current text input of the buffer. It will be based on the offset value currently stored in the buffer and newline character counts (i.e. characters \r and \n).

Text buffer would need to do some book keeping based on the parameters specified above for properties row and previous newline byte offset. It needs to add access methods row() and column() where the row will just render the property row, whereas column will be based on current offset value and previous newline byte offset.

To implement this feature here are the list of changes required:

  • Modify winnow parser methods for getting newline count
    • match_whitespace0
    • match_whitespace1
    • match_text_until_unescaped
  • Write unit tests to verify buffer properties row and column results into correct numbers

Reference WIP: 2af4d3c

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

1 participant