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: Add support for regex expressions #125

Merged
merged 20 commits into from
Nov 18, 2024
Merged

feat: Add support for regex expressions #125

merged 20 commits into from
Nov 18, 2024

Conversation

deepakraog
Copy link
Contributor

Add support for regex expressions #96

@deepakraog deepakraog self-assigned this Nov 6, 2024
@deepakraog deepakraog requested a review from a team as a code owner November 6, 2024 08:03
@deepakraog deepakraog changed the title wip: handling regex pattern use cases wip: handling regex expressions Nov 6, 2024
@deepakraog deepakraog changed the title wip: handling regex expressions wip: Add support for regex expressions Nov 6, 2024
Copy link
Contributor

@tommy tommy left a comment

Choose a reason for hiding this comment

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

I replaced the replacement string handling for $replace with a new parser for the match groups. I think there are too many sledge cases to do it reliably with splitting/etc. those tests pass now, haven't gotten to the failing tests using replacement functions.

src/evaluator/functions.rs Outdated Show resolved Hide resolved
src/evaluator/functions.rs Outdated Show resolved Hide resolved
@tommy tommy changed the title wip: Add support for regex expressions feat: Add support for regex expressions Nov 16, 2024
@tommy
Copy link
Contributor

tommy commented Nov 16, 2024

Remaining test cases are passing. Evaluating the Value::Lambda (for the "replace with function call" syntax) apparently returns another Value::Lambda. So, I reused the trampoline loop from a different part of the evaluator to repeatedly evaluate until reaching a final result.

@tommy tommy merged commit 0042b42 into main Nov 18, 2024
8 checks passed
@tommy tommy deleted the drg/regex_fns branch November 18, 2024 14:14
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.

3 participants