#include "../hyper.h" #include #include namespace hr { char buf[10000000]; int bufpos; bool chk(const char *s) { char *t = buf+bufpos; while(*s == *t) s++, t++; return *s == 0; } bool eat(const char *s) { bool ret = chk(s); if(ret) bufpos += strlen(s); return ret; } char eatchar() { return buf[bufpos++]; } set seen; void check_ex(string s, string help) { if(seen.count(s)) return; seen.insert(s); if(!translation_exists(s)) println(hlog, "S(", as_nice_cstring(s), ", ", help, ")"); } void check_nonliteral(string s, string fname, int line) { if(seen.count(s)) return; seen.insert(s); string thu = "", end = ""; for(char c: s) if(c == '[') break; else thu += c; for(char c: s) if(c == ']') end = ""; else end += c; if(s == "s") ; else if(thu == "minetexts") for(string m: minetexts) check_ex(m, s); else if(thu == "dfnames") for(string m: dfnames) check_ex(m, s); else if(thu == "ncnames") for(string m: ncnames) check_ex(m, s); else if(thu == "slides" && end == ".help") ; // for(auto sl: tour::slides) check_ex(sl.help); else if(thu == "slides" && end == ".name") ; // for(auto sl: tour::slides) check_ex(sl.name); else if(end == ".menu_displayed_name") ; // for(auto g: ginf) check_ex(g.menu_displayed_name); else if(end == ".tiling_name") ; // for(auto g: ginf) check_ex(g.tiling_name); else if(end == ".name_hyperbolic") for(auto md: mdinf) check_ex(md.name_hyperbolic, s); else if(end == ".name_spherical") for(auto md: mdinf) { if(md.name_spherical != md.name_hyperbolic) check_ex(md.name_spherical, s); } else if(end == ".name_euclidean") for(auto md: mdinf) { if(md.name_euclidean != md.name_hyperbolic && md.name_euclidean != md.name_hyperbolic) check_ex(md.name_euclidean, s); } else if(thu == "olrdesc") ; else if(thu == "wdmodes") for(string m: wdmodes) check_ex(m, s); else if(thu == "axemodes") for(string m: multi::axemodes) check_ex(m, s); else if(thu == "axmodes") for(string m: multi::axmodes) check_ex(m, s); else if(thu == "mpnames") for(string m: texture::mpnames) check_ex(m, s); else if(thu == "axemodes3") for(string m: multi::axemodes3) check_ex(m, s); else if(thu == "mdmodes") for(string m: mdmodes) check_ex(m, s); else if(thu == "hlmodes") for(string m: hlmodes) check_ex(m, s); else if(thu == "current_filter->name") for(auto f: available_filters) check_ex(f->name, s); else if(thu == "olrDescriptions") for(string m: olrDescriptions) check_ex(m, s); else if(thu == "shmupcmdtable") ; else if(thu == "stringx") ; else if(thu == "lv.msg") ; /* trust */ else if(thu == "opt") ; /* todo */ else if(thu == "menu_item_name") ; /* todo */ else if(s == "winf[w].help") ; else if(s == "linf[l].help") ; else if(s == "iinf[it].help") ; else if(s == "minf[m].help") ; else if(among(s, "mapeditorhelp", "patthelp", "drawhelp", "warpdesc", "hyperstone_optional", "irrhelp", "helptext", "inv::helptext", "power_help", "trollhelp2")) ; /* trust */ else println(hlog, "// unrecognized nonliteral: ", s, " in ", fname, ":", line); } void check_xlat_content(string s, string fname, int line) { // println(hlog, "// xlat content found: ", s); string literal = ""; string nonliteral = ""; bool in_quote = false; int i = 0; while(i < isize(s)) { auto chk = [&] (string mname, string mvalue) { if(in_quote) return false; for(int k=0; kd_name; if(s.size() > 4 && s.substr(s.size()-4) == ".cpp") check_file(s); } closedir(d); } println(hlog, "// checking configurables"); for(auto& fs: params) { auto& sett = fs.second; if(sett->menu_item_name != sett->config_name) check_ex(sett->menu_item_name, "menu_item_name for " + sett->parameter_name); check_ex(sett->help_text, "help_text for " + sett->parameter_name); auto ls = dynamic_cast ( (setting*) &*sett); if(ls) for(auto opt: ls->options) { check_ex(opt.first, "option first for " + sett->parameter_name); check_ex(opt.second, "option second for " + sett->parameter_name); } } exit(0); } auto ar = arg::add3("-gentrans", gentrans); }