complex can now be used as an identifier

Remove final vestiges of 'complex' keyword.

Closes #252
This commit is contained in:
William S Fulton 2020-10-10 16:07:55 +01:00
commit 638ca8152d
5 changed files with 25 additions and 1 deletions

View file

@ -718,6 +718,7 @@ C_TEST_CASES += \
nested_extend_c \
nested_structs \
newobject2 \
not_ckeywords \
overload_extend_c \
overload_extend2 \
preproc \

View file

@ -0,0 +1,13 @@
%module not_c_keywords
%extend ComplexStruct {
void init() {
$self->complex = 123;
}
}
%inline %{
struct ComplexStruct {
int complex; /* complex as variable name */
};
%}

View file

@ -0,0 +1,7 @@
from not_c_keywords import *
cs = ComplexStruct()
cs.init()
if cs.complex != 123:
raise RuntimeError("complex not correct")
cs.complex = 456