-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
%feature
and asterisks
#2657
Comments
Maybe, as a first step, |
It is a bug: Line 771 in 856d6f2
|
I have a fix in mmomtchev@d45b509 that depends on NAPI async, I will push it through after it is merged |
Only a class wildcard is currently supported. I don't think Allowing the match stuff from rename to work for
|
Why not simply extend |
I left that part as I don't really know, but in a quick test it looks to me like the feature gets applied to the class and constructor because both match the specified name As to extending it as a generic change to how features work, I'd worry about breaking compatibility with usage of existing features which doesn't expect a feature applied to a class to get applied to class members implicitly, and there then doesn't seem an easy way to only apply a feature to a class (because there isn't a way to specify all members of a class...) If you want these semantics for a particular new feature, you can probably just check the member for the feature and if it's not set there, check the parent class for it. |
This would require to completely overhaul the features code because features are currently stored as a hash on the matching name, so having this: %feature("async", "Async");
%feature("async", "0", %$classname="Klass"); The second directive simply overwrites the first one as both apply to the global context (an empty name). The code expects this to apply to all class members: %feature("async", "Async") Klass::; However this statement violates the grammar. What about changing the grammar? |
How about %feature("async", "Async") Klass...; The problem with |
It seems confusing to reuse If we have to make up a syntax, we could perhaps use something like However I suspect we can make |
I can easily switch to |
This is a valid
%feature
:However this is not:
(this seems to get parsed as a member pointer in the
declarator
item in the grammar)This is valid too:
But in this case SWIG will make it available only to the class definition node (and the constructor) and not to the methods which still will get the global
%feature
. AFAIK, there isn't an easy way to check if the feature comes from the global features or from a local one to the symbol - which could make it possible to check the class feature when processing the class method.Is this a bug, or simply an oversight/missing feature?
Alas, regexping is implemented only for renaming, maybe a more generalized version should apply to all features.
The text was updated successfully, but these errors were encountered: