Fix when is 'self' used as a parameter name in Python
Fix corner case for variable names called 'self' after merging in patch #201
This commit is contained in:
parent
cd725fbe94
commit
a6efdb7999
3 changed files with 8 additions and 2 deletions
|
|
@ -35,6 +35,10 @@ KW(chan, fallthrough)
|
|||
KW(end, function)
|
||||
KW(nil,local)
|
||||
|
||||
struct Keywords {
|
||||
void selfkw(int self) {}
|
||||
};
|
||||
|
||||
%}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
#!/usr/bin/env python
|
||||
import keyword_rename
|
||||
keyword_rename._in(1)
|
||||
keyword_rename._except(1)
|
||||
|
||||
k = keyword_rename.Keywords()
|
||||
k.selfkw(123)
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ PYTHONKW(None);
|
|||
/*
|
||||
'self' is also a bad Name
|
||||
*/
|
||||
PYTHONBN(self);
|
||||
PYTHONKW(self);
|
||||
|
||||
#undef PYTHONBN
|
||||
#undef PYTHONKW
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue