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 f68b2e1b4d058e2f71585b5742d8ad98e1baa8dc..f689c99711d0626143f2026fc230d468d75beed0 100644
(file)
--- a/
src/language/data-io/data-list.c
+++ b/
src/language/data-io/data-list.c
@@
-120,7
+120,7
@@
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;
data_parser_set_records (parser, lex_integer (lexer));
lex_get (lexer);
goto error;
data_parser_set_records (parser, lex_integer (lexer));
lex_get (lexer);
@@
-129,7
+129,7
@@
cmd_data_list (struct lexer *lexer, struct dataset *ds)
else if (lex_match_id (lexer, "SKIP"))
{
lex_match (lexer, T_EQUALS);
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;
data_parser_set_skip (parser, lex_integer (lexer));
lex_get (lexer);
goto error;
data_parser_set_skip (parser, lex_integer (lexer));
lex_get (lexer);
@@
-229,7
+229,9
@@
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));
- data_parser_set_hard_delimiters (parser, ss_cstr (","));
+ const char decimal = settings_get_fmt_settings ()->decimal;
+ data_parser_set_hard_delimiters (parser,
+ ss_buffer (",", (decimal == '.') ? 1 : 0));
}
}
}
}
}
}
@@
-291,7
+293,7
@@
cmd_data_list (struct lexer *lexer, struct dataset *ds)
add_transformation (ds, data_list_trns_proc, data_list_trns_free, trns);
}
else
add_transformation (ds, data_list_trns_proc, data_list_trns_free, trns);
}
else
- data_parser_make_active_file (parser, ds, reader, dict);
+ data_parser_make_active_file (parser, ds, reader, dict
, NULL, NULL
);
fh_unref (fh);
free (encoding);
fh_unref (fh);
free (encoding);
@@
-301,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;
@@
-353,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
@@
-457,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
{