mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-02-02 20:29:17 +00:00
makeh:: accept #if inside #if HDR
This commit is contained in:
parent
c2d56fb9bc
commit
f0bf7096da
12
makeh.cpp
12
makeh.cpp
@ -26,7 +26,7 @@ void mark_file() {
|
|||||||
cout << ind() << "#endif\n", ifs_level--;
|
cout << ind() << "#endif\n", ifs_level--;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool in_hdr;
|
int in_hdr;
|
||||||
|
|
||||||
void gen(string s) {
|
void gen(string s) {
|
||||||
which_file = s;
|
which_file = s;
|
||||||
@ -35,10 +35,12 @@ void gen(string s) {
|
|||||||
while(s != "" && s[0] == ' ') s = s.substr(1);
|
while(s != "" && s[0] == ' ') s = s.substr(1);
|
||||||
while(s.back() == 10 || s.back() == 13) s = s.substr(0, s.size() - 1);
|
while(s.back() == 10 || s.back() == 13) s = s.substr(0, s.size() - 1);
|
||||||
if(in_hdr) {
|
if(in_hdr) {
|
||||||
if(s == "#endif" && in_hdr) {
|
if(s == "#endif")
|
||||||
in_hdr = false;
|
in_hdr--;
|
||||||
}
|
if(s.substr(0, 3) == "#if")
|
||||||
else cout << ind() << s << "\n";
|
in_hdr++;
|
||||||
|
if(in_hdr)
|
||||||
|
cout << ind() << s << "\n";
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(s == "#if HDR") {
|
if(s == "#if HDR") {
|
||||||
|
Loading…
Reference in New Issue
Block a user