-
Notifications
You must be signed in to change notification settings - Fork 42
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
Regression on local filter functions? #310
Comments
I also tried this: // isExported reports whether bound matcher var
// represents exported Go identifier.
var isExported = func(v dsl.Var) bool {
return v.Text.Matches(`^\p{Lu}`)
}
func exposedMutex(m dsl.Matcher) {
// isExported() is more readable than `^\p{Lu}`
// regular expression itself.
m.Match(`type $name struct { $*_; sync.Mutex; $*_ }`).
Where(isExported(m["name"])).
Report("do not embed sync.Mutex")
m.Match(`type $name struct { $*_; sync.RWMutex; $*_ }`).
Where(m["name"].Text.Matches(`^\p{Lu}`)).
Report("don not embed sync.RWMutex")
} But got a different error:
|
Hi. |
Hi @quasilyte , Got it, thanks for the response. I'm using version -Tim |
Hi @quasilyte , I was wondering if there was any updates on releasing a new version to include these changes. Thanks. |
I would like to investigate and fix #317 if it's reproducible. |
HI,
I'd like to use a local function as outlined in the Ruleguard by example documentation, but I encountered an error:
expected a m method call, found ...
. I then tried copying the exact example from the documentation and encountered the same error:Is this a feature that's still supported?
The text was updated successfully, but these errors were encountered: