Mercurial > mm7
comparison mm7text_ru.cpp @ 649:0e368c04acfb
Sleeping in a tavern
author | Nomad |
---|---|
date | Mon, 11 Mar 2013 23:43:52 +0200 |
parents | 35ce4761382c |
children | 2bf48d11d742 |
comparison
equal
deleted
inserted
replaced
648:35ce4761382c | 649:0e368c04acfb |
---|---|
1164 | 1164 |
1165 char buf[8192]; | 1165 char buf[8192]; |
1166 assert(strlen(str) < sizeof(buf)); | 1166 assert(strlen(str) < sizeof(buf)); |
1167 | 1167 |
1168 int next_integer_token = 0; | 1168 int next_integer_token = 0; |
1169 bool integer_tokens_defined[2] = {false, false}; | 1169 bool integer_tokens_defined[10] = {false, false, false, false, false, false, false, false, false, false}; |
1170 int integer_tokens[2] = {0, 0}; | 1170 int integer_tokens[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; |
1171 | 1171 |
1172 bool gender_token_defined = false; | 1172 bool gender_token_defined = false; |
1173 int gender_token = 0; | 1173 int gender_token = 0; |
1174 | 1174 |
1175 auto src = buf, | 1175 auto src = buf, |
1182 case 'I': | 1182 case 'I': |
1183 { | 1183 { |
1184 if (src[2] != '[') | 1184 if (src[2] != '[') |
1185 goto _invalid_token; | 1185 goto _invalid_token; |
1186 src += 3; // ^I[ | 1186 src += 3; // ^I[ |
1187 | 1187 |
1188 assert(next_integer_token < 10); | |
1188 if (sscanf(src, "%d", &integer_tokens[next_integer_token])) | 1189 if (sscanf(src, "%d", &integer_tokens[next_integer_token])) |
1189 integer_tokens_defined[next_integer_token++] = true; | 1190 integer_tokens_defined[next_integer_token++] = true; |
1190 | 1191 |
1191 auto int_begin = src; | 1192 auto int_begin = src; |
1192 while (*src++ != ']'); | 1193 while (*src++ != ']'); |