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

Clean up source text representation in the AST #21

Open
chalcolith opened this issue Aug 24, 2024 · 0 comments
Open

Clean up source text representation in the AST #21

chalcolith opened this issue Aug 24, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@chalcolith
Copy link
Owner

chalcolith commented Aug 24, 2024

Currently source text fragments are stored in semantic data for a limited set of nodes. When reconstructing a source file, it would be easiest if strings were stored on child Span nodes, and the semantic data pointed to those.

For example, eohippus-fmt currently uses the Loc info from the parse tree to reconstruct leaf node strings; this works because we always read directly from disk.

However, if we're reading from a cached parse tree, the Locs don't exist any more, so we couldn't do this for formatting in the lsp, say.

So we should store strings on the leaf Span nodes and have data fields point to them instead of storing the strings directly.

@chalcolith chalcolith added the enhancement New feature or request label Aug 24, 2024
@chalcolith chalcolith changed the title Clean up string representation in the AST Clean up source text representation in the AST Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant