-
Notifications
You must be signed in to change notification settings - Fork 204
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
FunctionDefinition.has_named_attribute(quote {test})
returns false for test functions
#6009
Comments
So, the idea of I also wonder if |
It definitely feels weird to provide a quoted value since right now attributes are more or less "free form", so a string feels more natural. IDK if it might affect something in the future, I'm fine with both! |
I'd be fine if the string just matched against the name but we should 100% avoid it matching against arguments as well. It works for a single word but we don't want to worry about spacing being different in the annotation or anything like that. |
# Description ## Problem Resolves #6009 ## Summary Also made it a bit more efficient. ## Additional Context ## Documentation Check one: - [x] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[For Experimental Features]** Documentation to be submitted in a separate PR. # PR Checklist - [x] I have tested the changes locally. - [x] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings.
What if we lexed both the argument and the attribute and check that the tokens match? That way spacing being different wouldn't be an issue. I'm still not sure about it, though. I'm just wondering what's the best way to check if something is annotated with |
Aim
I want to be able to filter out test functions when iterating through a module.
Expected Behavior
FunctionDefinition.has_named_attribute(quote {test})
returns true for#[test]
functions, or an extra.is_test()
helper is added.Bug
FunctionDefinition.has_named_attribute(quote {test})
for a test function returns false.To Reproduce
Workaround
None
Workaround Description
No response
Additional Context
No response
Project Impact
None
Blocker Context
No response
Nargo Version
No response
NoirJS Version
No response
Proving Backend Tooling & Version
No response
Would you like to submit a PR for this Issue?
None
Support Needs
No response
The text was updated successfully, but these errors were encountered: