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

[Bug] #endif is considered an invalid directive if anything is on the immediate line after #1715

Closed
1 task
EtiTheSpirit opened this issue May 25, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@EtiTheSpirit
Copy link

Operating System

Windows

What's the issue you encountered?

Bit of a strange one here.

If more than one static branch is used in a file, they must be broken apart by at least one line, lest #endif be unrecognized as a directive.

How can the issue be reproduced?

Create a new file (can be blank), and open the pattern editor.
Enter the following code to the pattern:

#ifdef GARBAGE
#endif
#ifndef GARBAGE
#endif

Attempt to compile this code. Line 4 will raise the following error:

E: error: Unknown directive 'endif'
E:   -->   in <Source Code>:4:7
E: 4 | #endif
E:           ^

Add a line break separating lines [1,2] and [3,4] as such:

#ifdef GARBAGE
#endif

#ifndef GARBAGE
#endif

Attempt to compile this code. This will succeed.

ImHex Version

1.33.2

ImHex Build Type

  • Nightly or built from sources

Installation type

MSI, Non-portable

Additional context?

No response

@EtiTheSpirit EtiTheSpirit added the bug Something isn't working label May 25, 2024
@EtiTheSpirit EtiTheSpirit changed the title [Bug] #endif is considered an invalid directive unless there is whitespace preceding the static branch [Bug] #endif is considered an invalid directive if anything is on the immediate line after May 25, 2024
@paxcut
Copy link
Contributor

paxcut commented May 25, 2024

This bug was fixed already on master (1.33.0) and the code without any spaces should compile and run without errors on a recent nightly master build. I just tried it on a May 14 nightly without any problems.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants