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

feat: call built-ins as predicate #557

Merged
merged 4 commits into from
Oct 24, 2024

Conversation

arendjr
Copy link
Contributor

@arendjr arendjr commented Oct 23, 2024

I also tried removing Predicate::Log in favor of Predicate::CallBuiltIn, but this turned out to be more complex, because the log implementation wants to inspect the variable being passed instead of only its value, so I left that as is for now.

Unfortunately, this leaves me without a good test case in this repo. Would you like me to create one?

Greptile Summary

This is an auto-generated summary

Hi! Looks like you've reached your API usage limit. You can increase it from your account settings page here: app.greptile.com/settings/usage

@morgante
Copy link
Contributor

I also tried removing Predicate::Log in favor of Predicate::CallBuiltIn, but this turned out to be more complex, because the log implementation wants to inspect the variable being passed instead of only its value, so I left that as is for now.

We can probably ditch that functionality if it's making the merger harder. I don't consider it critical.

Unfortunately, this leaves me without a good test case in this repo. Would you like me to create one?

It would probably be good to have a simple one just as a test.

@arendjr arendjr marked this pull request as ready for review October 24, 2024 09:43
@arendjr arendjr requested a review from a team as a code owner October 24, 2024 09:43
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

LGTM

20 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@arendjr
Copy link
Contributor Author

arendjr commented Oct 24, 2024

Good news: I was able to move the inspection of the variable to the log compiler instead, so Predicate::Log and Pattern::Log are now both replaced with a built-in without loss of functionality.

Copy link
Contributor

@morgante morgante left a comment

Choose a reason for hiding this comment

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

Thanks, looks good! Ideally we'd remove the special log from the grammar entirely but this is good enough.

@morgante morgante merged commit a1b312b into getgrit:main Oct 24, 2024
5 checks passed
This was referenced Oct 24, 2024
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