projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
token: Update functional interface and add token_copy(), token_equal().
[pspp]
/
src
/
language
/
data-io
/
data-list.c
diff --git
a/src/language/data-io/data-list.c
b/src/language/data-io/data-list.c
index 0b98f40a07e2a2e08d6e54ce0a944473f68c1738..f689c99711d0626143f2026fc230d468d75beed0 100644
(file)
--- a/
src/language/data-io/data-list.c
+++ b/
src/language/data-io/data-list.c
@@
-120,31
+120,18
@@
cmd_data_list (struct lexer *lexer, struct dataset *ds)
{
lex_match (lexer, T_EQUALS);
lex_match (lexer, T_LPAREN);
{
lex_match (lexer, T_EQUALS);
lex_match (lexer, T_LPAREN);
- if (!lex_force_int
(lexer
))
+ if (!lex_force_int
_range (lexer, "RECORDS", 0, INT_MAX
))
goto error;
goto error;
-
- int records = lex_integer (lexer);
- if (records < 0)
- {
- msg (SE, _("The %s value must be nonnegative."), "RECORDS");
- goto error;
- }
- data_parser_set_records (parser, records);
+ data_parser_set_records (parser, lex_integer (lexer));
lex_get (lexer);
lex_match (lexer, T_RPAREN);
}
else if (lex_match_id (lexer, "SKIP"))
{
lex_match (lexer, T_EQUALS);
lex_get (lexer);
lex_match (lexer, T_RPAREN);
}
else if (lex_match_id (lexer, "SKIP"))
{
lex_match (lexer, T_EQUALS);
- if (!lex_force_int
(lexer
))
+ if (!lex_force_int
_range (lexer, "SKIP", 0, INT_MAX
))
goto error;
goto error;
- int skip = lex_integer (lexer);
- if (skip < 0)
- {
- msg (SE, _("The %s value must be nonnegative."), "SKIP");
- goto error;
- }
- data_parser_set_skip (parser, skip);
+ data_parser_set_skip (parser, lex_integer (lexer));
lex_get (lexer);
}
else if (lex_match_id (lexer, "END"))
lex_get (lexer);
}
else if (lex_match_id (lexer, "END"))
@@
-242,7
+229,7
@@
cmd_data_list (struct lexer *lexer, struct dataset *ds)
data_parser_set_quotes (parser, ss_cstr ("'\""));
data_parser_set_soft_delimiters (parser,
ss_cstr (CC_SPACES));
data_parser_set_quotes (parser, ss_cstr ("'\""));
data_parser_set_soft_delimiters (parser,
ss_cstr (CC_SPACES));
- const char decimal = settings_get_
decimal_char (FMT_F)
;
+ const char decimal = settings_get_
fmt_settings ()->decimal
;
data_parser_set_hard_delimiters (parser,
ss_buffer (",", (decimal == '.') ? 1 : 0));
}
data_parser_set_hard_delimiters (parser,
ss_buffer (",", (decimal == '.') ? 1 : 0));
}
@@
-316,7
+303,7
@@
cmd_data_list (struct lexer *lexer, struct dataset *ds)
error:
data_parser_destroy (parser);
if (!in_input_program ())
error:
data_parser_destroy (parser);
if (!in_input_program ())
- dict_
destroy
(dict);
+ dict_
unref
(dict);
fh_unref (fh);
free (encoding);
return CMD_CASCADING_FAILURE;
fh_unref (fh);
free (encoding);
return CMD_CASCADING_FAILURE;
@@
-368,7
+355,8
@@
parse_fixed (struct lexer *lexer, struct dictionary *dict,
if (v != NULL)
{
/* Success. */
if (v != NULL)
{
/* Success. */
- struct fmt_spec output = fmt_for_output_from_input (f);
+ struct fmt_spec output = fmt_for_output_from_input (
+ f, settings_get_fmt_settings ());
var_set_both_formats (v, &output);
}
else
var_set_both_formats (v, &output);
}
else
@@
-472,7
+460,8
@@
parse_free (struct lexer *lexer, struct dictionary *dict,
if (input.type == FMT_N)
input.type = FMT_F;
if (input.type == FMT_N)
input.type = FMT_F;
- output = fmt_for_output_from_input (&input);
+ output = fmt_for_output_from_input (&input,
+ settings_get_fmt_settings ());
}
else
{
}
else
{