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

Added more basic interfaces #1607

Merged
merged 2 commits into from
Jul 25, 2024
Merged

Added more basic interfaces #1607

merged 2 commits into from
Jul 25, 2024

Conversation

oxisto
Copy link
Member

@oxisto oxisto commented Jul 1, 2024

This PR adds more basic interfaces. It solves the issue that we currently either have a direct node in our utility functions (for example symbol resolving), e.g. a CallExpression or some very specific interfaces HasBase. But as we for example need a name for the HasBase interface/node, we need to do a very ugly as Node cast.

Therefore, in this PR we are adding some more basic interfaces that "describe" nodes, e.g., whether they have a name, location (actually all of the nodes have that) and a mixture of that.

This is prep work for #1606, for example where we need to share a common interface between calls and operator expressions which are overloadable. Something which is currently not yet possible with the current interfaces.

@oxisto oxisto marked this pull request as ready for review July 1, 2024 19:19
@oxisto oxisto force-pushed the interfaces branch 3 times, most recently from 11f2557 to 8784924 Compare July 2, 2024 18:21
Copy link
Contributor

@KuechA KuechA left a comment

Choose a reason for hiding this comment

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

I don't see how this solves the problem of casts between different interfaces. Shouldn't the "specific" interfaces extend the "basic" ones (e.g. HasBase: HasLanguage, HasNameAndLocation) to accomplish this?

This PR adds more basic interfaces
Copy link

sonarcloud bot commented Jul 25, 2024

@oxisto oxisto merged commit 96849df into main Jul 25, 2024
3 checks passed
@oxisto oxisto deleted the interfaces branch July 25, 2024 13:12
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.

2 participants