Skip to content

fix: Use regex for test function name parsing in debugger build script#8381

Closed
GarmashAlex wants to merge 1 commit intonoir-lang:masterfrom
GarmashAlex:hpp2
Closed

fix: Use regex for test function name parsing in debugger build script#8381
GarmashAlex wants to merge 1 commit intonoir-lang:masterfrom
GarmashAlex:hpp2

Conversation

@GarmashAlex
Copy link
Contributor

@GarmashAlex GarmashAlex commented May 6, 2025

Description

This PR replaces the multiple .split() and .unwrap() calls used for parsing test function names in the debugger build script with a regex-based approach. The new implementation:

  1. Adds a regex dependency to tooling/debugger/Cargo.toml
  2. Uses a regex pattern to extract function names that handles generics and arguments properly
  3. Maintains a fallback to the old method for backward compatibility

This makes the test function name parsing more robust and maintainable, while avoiding potential panic situations when parsing complex function signatures.

Problem*

Fix issue #8352

Additional Context

The previous implementation was using a series of string splits and unwraps which could fail when dealing with more complex function signatures. The regex approach provides a cleaner and more reliable solution.

Documentation*

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation to be submitted in a separate PR.

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@github-actions
Copy link
Contributor

github-actions bot commented May 6, 2025

Thank you for your contribution to the Noir language.

Please do not force push to this branch after the Noir team have started review of this PR. Doing so will only delay us merging your PR as we will need to start the review process from scratch.

Thanks for your understanding.

@TomAFrench
Copy link
Member

TomAFrench commented May 6, 2025

Is this completely AI generated?

@GarmashAlex
Copy link
Contributor Author

Is this completely AI generated?

Most of this :( Sorry... I was trying to find a useful way to contribute.

@TomAFrench
Copy link
Member

We have a policy of not accepting PRs which consist entirely of LLM output due to the fact that it ends up functionally being a DOS on maintainers because we then need to do all the checking which would otherwise be done by the author (as shown by this PR keeping the old method as a fallback).

I'm sorry but I'm going to close this PR.

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