Rev 65 | Rev 68 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 65 | Rev 66 | ||
---|---|---|---|
Line 132... | Line 132... | ||
132 | int file_size; |
132 | int file_size; |
133 | int length; |
133 | int length; |
134 | int char_index; |
134 | int char_index; |
135 | int fieldstart; |
135 | int fieldstart; |
136 | int fieldstop; |
136 | int fieldstop; |
- | 137 | int variation_depth; |
|
137 | char movenumber_string[8]; |
138 | char movenumber_string[8]; |
138 | FILE *fp; |
139 | FILE *fp; |
139 | 140 | ||
140 | // did we chose NO game ? |
141 | // did we chose NO game ? |
141 | if (game == NULL) |
142 | if (game == NULL) |
Line 242... | Line 243... | ||
242 | // else is it a numeric annotation glyph ? if so, just ignore it (FIXME: better support this) |
243 | // else is it a numeric annotation glyph ? if so, just ignore it (FIXME: better support this) |
243 | else if (file_data[char_index] == '$') |
244 | else if (file_data[char_index] == '$') |
244 | { |
245 | { |
245 | while ((char_index < file_size) && !isspace (file_data[char_index])) |
246 | while ((char_index < file_size) && !isspace (file_data[char_index])) |
246 | char_index++; // figure out where it stops |
247 | char_index++; // figure out where it stops |
- | 248 | while ((char_index < file_size) && isspace (file_data[char_index])) |
|
- | 249 | char_index++; // figure out where the next word starts |
|
- | 250 | ||
- | 251 | continue; // and proceed to the next data |
|
- | 252 | } |
|
- | 253 | ||
- | 254 | // else is it a variation ? if so, just ignore it (FIXME: better support this) |
|
- | 255 | else if (file_data[char_index] == '(') |
|
- | 256 | { |
|
- | 257 | variation_depth = 1; |
|
- | 258 | while ((char_index < file_size) && (variation_depth != 0)) |
|
- | 259 | { |
|
- | 260 | char_index++; // move through file data and cope with nested variations |
|
- | 261 | if (file_data[char_index] == '(') variation_depth++; |
|
- | 262 | else if (file_data[char_index] == ')') variation_depth--; |
|
- | 263 | } |
|
- | 264 | char_index++; // skip the closing parenthese |
|
247 | while ((char_index < file_size) && isspace (file_data[char_index])) |
265 | while ((char_index < file_size) && isspace (file_data[char_index])) |
248 | char_index++; // figure out where the next word starts |
266 | char_index++; // figure out where the next word starts |
249 | 267 | ||
250 | continue; // and proceed to the next data |
268 | continue; // and proceed to the next data |
251 | } |
269 | } |