Skip to content
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

several #elseif expect as many #endif #31

Open
elrandira opened this issue Dec 20, 2021 · 0 comments
Open

several #elseif expect as many #endif #31

elrandira opened this issue Dec 20, 2021 · 0 comments

Comments

@elrandira
Copy link

elrandira commented Dec 20, 2021

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

@elrandira elrandira changed the title several #elseif expected as many in #endif several #elseif expect as many #endif Dec 20, 2021
elrandira pushed a commit to elrandira/pypreprocessor that referenced this issue Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant