| 445 | // |
| 446 | |
| 447 | SSHORT EXP_SSHORT_ordinal(bool advance_flag) |
| 448 | { |
| 449 | const bool negate = (MSC_match(KW_MINUS)); |
| 450 | |
| 451 | if (gpreGlob.token_global.tok_type != tok_number) |
| 452 | CPR_s_error("<number>"); |
| 453 | |
| 454 | const SLONG n = atoi(gpreGlob.token_global.tok_string); |
| 455 | if (negate && n > -1L * MIN_SSHORT) |
| 456 | PAR_error("Numeric value out of range"); |
| 457 | else if (!negate && n > (SLONG) MAX_SSHORT) |
| 458 | PAR_error("Numeric value out of range"); |
| 459 | |
| 460 | if (advance_flag) |
| 461 | PAR_get_token(); |
| 462 | |
| 463 | return (SSHORT) (negate ? -n : n); |
| 464 | } |
| 465 | |
| 466 | |
| 467 | //____________________________________________________________ |
no test coverage detected