1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-01-23 15:36:59 +00:00

makeh:: accept #if inside #if HDR

This commit is contained in:
Zeno Rogue 2019-08-09 21:05:54 +02:00
parent c2d56fb9bc
commit f0bf7096da

View File

@ -26,7 +26,7 @@ void mark_file() {
cout << ind() << "#endif\n", ifs_level--;
}
bool in_hdr;
int in_hdr;
void gen(string s) {
which_file = s;
@ -35,10 +35,12 @@ void gen(string s) {
while(s != "" && s[0] == ' ') s = s.substr(1);
while(s.back() == 10 || s.back() == 13) s = s.substr(0, s.size() - 1);
if(in_hdr) {
if(s == "#endif" && in_hdr) {
in_hdr = false;
}
else cout << ind() << s << "\n";
if(s == "#endif")
in_hdr--;
if(s.substr(0, 3) == "#if")
in_hdr++;
if(in_hdr)
cout << ind() << s << "\n";
continue;
}
if(s == "#if HDR") {