- if (var_is_alpha (vars[0]))
- {
- if (lex_token (lexer) != T_STRING)
- {
- lex_error (lexer, _("expecting string"));
- return 0;
- }
- buf_copy_str_rpad (value.s, MAX_SHORT_STRING, ds_cstr (lex_tokstr (lexer)));
- }
- else
- {
- if (!lex_is_number (lexer))
- {
- lex_error (lexer, _("expecting integer"));
- return 0;
- }
- if (!lex_is_integer (lexer))
- msg (SW, _("Value label `%g' is not integer."), lex_tokval (lexer));
- value.f = lex_tokval (lexer);
- }
- lex_get (lexer);
+ value_init (&value, width);
+ if (!parse_value (lexer, &value, width))
+ {
+ value_destroy (&value, width);
+ return 0;
+ }