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

MultiSourceLine.getSourceAndLineFromOverallLine() generates a lot of objects #2210

Open
andimarek opened this issue Feb 17, 2021 · 3 comments
Labels

Comments

@andimarek
Copy link
Member

No description provided.

@bbakerman
Copy link
Member

It has to track three things - a column, and line number and the source name that the text came from

It allocates a SourceAndLine sourceAndLine = new SourceAndLine(); and then a new SourceLocation(line, column, sourceAndLine.getSourceName()); for every AST node - so 2 per AST node

How would you do it otherwise? Move the source and col and int INTO the AST nodes themselves

@bbakerman
Copy link
Member

SourceAndLine should have a very short life span - SourceLocation lives as long as the AST node

Copy link

Hello, this issue has been inactive for 60 days, so we're marking it as stale. If you would like to continue this discussion, please comment within the next 30 days or we'll close the issue.

@github-actions github-actions bot added the Stale label Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants
@bbakerman @andimarek and others