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

Adding very basic support for #if/#endif #14

Merged
merged 1 commit into from
Jan 30, 2017
Merged

Conversation

gulgi
Copy link

@gulgi gulgi commented Jan 30, 2017

This code makes the TryError code ignore #if blocks.

Code like:
#if defined(WIN32)
#include <Windows.h>
#elif defined(LINUX)
#include <linux-only-file.h>
#endif
..did not work at all.

It would be a lot better to tap into intellisense:s "inactive code" for proper #if/#ifdef, or just write a proper parser.
This works for now, though. :)

#if / #endif wasn't handled at all.
This changes it so includes inside an #if(def) block is ignored.
(It would be 100 times better to tap into Intellisense's "Inactive Code". That or parse #ifdef:s properly. )
@Wumpf
Copy link
Owner

Wumpf commented Jan 30, 2017

Thank you very much for your contribution! Ugh, this function gets really ugly now, need to clean this up at some point. But looks solid enough and as you're writing that should be okay for now, clearly better than the behaviour before that would just eat away ifdefed includes.

Using intellisense for that sounds like a good idea. Since you recently pointed out that the CompilerTool apparently has some connection to IntelliSense already, this might be possible. Not super confident though. New issue #15

@Wumpf Wumpf merged commit 52e32cf into Wumpf:master Jan 30, 2017
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

Successfully merging this pull request may close these issues.

None yet

2 participants