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

Provide a public API to compare precedence groups #2258

Open
allevato opened this issue Oct 3, 2023 · 3 comments
Open

Provide a public API to compare precedence groups #2258

allevato opened this issue Oct 3, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@allevato
Copy link
Collaborator

allevato commented Oct 3, 2023

Description

I had a small use case in swift-format where I wanted to check the precedence of an operator relative to another one (apple/swift-format#647).

Unfortunately there's no public API to do this from OperatorTable; the logic is inside PrecedenceGraph, which is internal. Can we have this API or something like it in public form?

@allevato allevato added the enhancement New feature or request label Oct 3, 2023
@ahoppen
Copy link
Collaborator

ahoppen commented Oct 3, 2023

Tracked in Apple’s issue tracker as rdar://116416740

@ahoppen
Copy link
Collaborator

ahoppen commented Oct 4, 2023

I wouldn’t be opposed to adding a public function to perform this comparison on OperatorTable.

@allevato
Copy link
Collaborator Author

allevato commented Oct 5, 2023

Thanks! It's not an urgent need but I'll tinker with it and put up a PR.

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

2 participants