/* PSPP - computes sample statistics.
Copyright (C) 2005, 2006 Free Software Foundation, Inc.
/* PSPP - computes sample statistics.
Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
/* 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 (double *x, double *y, const struct fmt_spec *f)
+parse_num_range (struct lexer *lexer,
+ double *x, double *y, const enum fmt_type *format)
- 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 (&tokstr);
- di.e = ds_end (&tokstr);
- di.v = &v;
- di.flags = 0;
- di.f1 = 1;
- di.f2 = ds_length (&tokstr);
- di.format = *f;
- data_in (&di);
- lex_get ();
+ data_in (ds_ss (lex_tokstr (lexer)), *format, 0, 0, &v, 0);
+ lex_get (lexer);