Generate correct lang tag count, not hardcoded.

This commit is contained in:
John Preston 2017-04-13 11:51:47 +03:00
parent 670a725c53
commit dd005d9027
1 changed files with 4 additions and 2 deletions

View File

@ -32,6 +32,8 @@ namespace codegen {
namespace lang {
namespace {
constexpr auto kMaxPluralVariants = 6;
char hexChar(uchar ch) {
if (ch < 10) {
return '0' + ch;
@ -139,8 +141,8 @@ LangString langCounted(ushort key0, ushort tag, float64 value);\n\
}
header_->stream() << "\
\n\
constexpr auto lngtags_cnt = 70;\n\
constexpr auto lngtags_max_counted_values = 6;\n\
constexpr auto lngtags_cnt = " << langpack_.tags.size() << ";\n\
constexpr auto lngtags_max_counted_values = " << kMaxPluralVariants << ";\n\
\n\
enum LangKey {\n";
for (auto &entry : langpack_.entries) {