pypreprocessor
pypreprocessor copied to clipboard
several #elseif expect as many #endif
I don't know what people expect: The following code is valid according to the current algorithm
#if A
print('A')
#elseif B
print('B')
#elseif C
print('C')
#else
print('D')
#endif
#endif
#endif
or this one:
#if A
print('A')
#elseif B
print('B')
#elseif C
print('C')
#else
print('D')
#endif3
but no this one (which is valid in C if I am not wrong):
#if A
print('A')
#elseif B
print('B')
#elseif C
print('C')
#else
print('D')
#endif
shouldn't it be the reverse?
https://docs.microsoft.com/en-us/cpp/preprocessor/hash-if-hash-elif-hash-else-and-hash-endif-directives-c-cpp?view=msvc-170