Last active
August 29, 2015 13:57
-
-
Save rikkimax/9566069 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
Include: test.h | |
Include: test2.h | |
Unknown: { | |
something | |
} | |
Condition: 1 + 1 == 2 { | |
} | |
Unknown: { | |
woot | |
} | |
End condition | |
Condition: defined _WIN32 { | |
} | |
Unknown: { | |
is windows | |
} | |
Else condition: defined __unix__ { | |
} | |
Unknown: { | |
is unix | |
} | |
End condition | |
Define variable: PI { | |
3.14159 | |
} | |
Undefine: PI | |
Define function: RADTODEG(x) { | |
((x) * 57.29578) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module main; | |
import defs; | |
import parser; | |
import std.stdio; | |
void main() { | |
PPFile file = PPFile(""" | |
#include \"test.h\" | |
#include <test2.h> | |
something | |
#if 1 + 1 == 2 | |
woot | |
#endif | |
#ifdef _WIN32 | |
is windows | |
#elif defined __unix__ | |
is unix | |
#endif | |
#define PI 3.14159 | |
#undef PI | |
#define RADTODEG(x) ((x) * 57.29578) | |
"""); | |
executePPParser(file); | |
writeln(file.toString()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment