/* Parses and stores a numeric value, or a range of the form "x
THRU y". Open-ended ranges may be specified as "LO(WEST) THRU
y" or "x THRU HI(GHEST)". Sets *X and *Y to the range or the
value and returns success.
/* Parses and stores a numeric value, or a range of the form "x
THRU y". Open-ended ranges may be specified as "LO(WEST) THRU
y" or "x THRU HI(GHEST)". Sets *X and *Y to the range or the
value and returns success.
- Numeric values are always accepted. If F is nonnull, then
- string values are also accepted, and converted to numeric
- values using the specified format. */
+ Numeric values are always accepted. If FORMAT is nonnull,
+ then string values are also accepted, and converted to numeric
+ values using *FORMAT. */
-parse_num_range (struct lexer *lexer, double *x, double *y, const struct fmt_spec *f)
+parse_num_range (struct lexer *lexer,
+ double *x, double *y, const enum fmt_type *format)
return false;
if (lex_match_id (lexer, "THRU"))
{
if (lex_match_id (lexer, "HI") || lex_match_id (lexer, "HIGHEST"))
*y = HIGHEST;
return false;
if (lex_match_id (lexer, "THRU"))
{
if (lex_match_id (lexer, "HI") || lex_match_id (lexer, "HIGHEST"))
*y = HIGHEST;
- Numeric values are always accepted. If F is nonnull, then
- string values are also accepted, and converted to numeric
- values using the specified format. */
+ Numeric values are always accepted. If FORMAT is nonnull,
+ then string values are also accepted, and converted to numeric
+ values using *FORMAT. */
- di.s = ds_data (lex_tokstr (lexer));
- di.e = ds_end (lex_tokstr (lexer));
- di.v = &v;
- di.flags = 0;
- di.f1 = 1;
- di.f2 = ds_length (lex_tokstr (lexer));
- di.format = *f;
- data_in (&di);
+ data_in (ds_ss (lex_tokstr (lexer)), *format, 0, 0, &v, 0);