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

Add BuiltinFnEnum #130

Merged
merged 1 commit into from
Nov 21, 2022
Merged

Add BuiltinFnEnum #130

merged 1 commit into from
Nov 21, 2022

Conversation

ZibingZhang
Copy link
Contributor

Overview

Creates an enum class BuiltinFnEnum which lets us easily reuse common function names.

Details

We can see this already being used in the function expander like so:

return ast.Call(
    func=ast.Name(id=constants.BuiltinFnName.SQRT.value, ctx=ast.Load()),
    args=[args_reduced],
)

As more function expanders are written, this will be used more.

References

Inspired from this conversation: #125 (comment)

Blocked by

None

@ZibingZhang ZibingZhang requested a review from odashi as a code owner November 21, 2022 14:36
Copy link
Collaborator

@odashi odashi left a comment

Choose a reason for hiding this comment

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

Thanks!

@odashi odashi merged commit 70347a2 into google:main Nov 21, 2022
@odashi odashi added this to the v0.3 milestone Nov 21, 2022
@ZibingZhang ZibingZhang deleted the built-in-fn-enum branch November 22, 2022 00:13
@odashi odashi mentioned this pull request Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants