pspp
2 years agoRANK: Improve error messages and coding style.
Ben Pfaff [Sun, 20 Nov 2022 22:03:13 +0000 (14:03 -0800)]
RANK: Improve error messages and coding style.

2 years agoONEWAY: Improve error messages and coding style.
Ben Pfaff [Sun, 20 Nov 2022 21:54:37 +0000 (13:54 -0800)]
ONEWAY: Improve error messages and coding style.

2 years agoGRAPH: Improve error messages and coding style.
Ben Pfaff [Sun, 20 Nov 2022 21:29:12 +0000 (13:29 -0800)]
GRAPH: Improve error messages and coding style.

2 years agoLOGISTIC REGRESSION: Improve error messages and coding style.
Ben Pfaff [Sun, 20 Nov 2022 19:28:02 +0000 (11:28 -0800)]
LOGISTIC REGRESSION: Improve error messages and coding style.

2 years agoGLM: Improve error messages and coding style.
Ben Pfaff [Sun, 20 Nov 2022 17:58:01 +0000 (09:58 -0800)]
GLM: Improve error messages and coding style.

2 years agosplit-file: New function output_split_file_values_peek().
Ben Pfaff [Sun, 20 Nov 2022 17:52:31 +0000 (09:52 -0800)]
split-file: New function output_split_file_values_peek().

This helper function encapsulates what most of the callers were doing.

2 years agocasereader: Add const to casereader_peek() and casereader_is_empty().
Ben Pfaff [Sun, 20 Nov 2022 17:51:09 +0000 (09:51 -0800)]
casereader: Add const to casereader_peek() and casereader_is_empty().

These don't affect the external state of a casereader even though they can
affect its internal state.

2 years agocasereader-shim: Fix typo in comment.
Ben Pfaff [Sun, 20 Nov 2022 17:50:21 +0000 (09:50 -0800)]
casereader-shim: Fix typo in comment.

2 years agoDisentangle the interaction parser from the variable parser.
Ben Pfaff [Sun, 20 Nov 2022 17:02:00 +0000 (09:02 -0800)]
Disentangle the interaction parser from the variable parser.

Both GLM and LOGISTIC REGRESSION used the interaction parser, but only GLM
used it to parse interactions in the full sense.  LOGISTIC REGRESSION was
just parsing a list of variables and then creating interactions from them.
This commit moves the interaction parser from variable-parser into GLM and
adds new code to LOGISTIC REGRESSION that satisfies its needs.

2 years agoGLM: Improve error messages and coding style.
Ben Pfaff [Sun, 20 Nov 2022 02:57:53 +0000 (18:57 -0800)]
GLM: Improve error messages and coding style.

2 years agoFACTOR: Improve error messages and coding style.
Ben Pfaff [Sun, 20 Nov 2022 01:48:08 +0000 (17:48 -0800)]
FACTOR: Improve error messages and coding style.

2 years agoQUICK CLUSTER: Improve error messages and coding style.
Ben Pfaff [Sun, 20 Nov 2022 01:00:57 +0000 (17:00 -0800)]
QUICK CLUSTER: Improve error messages and coding style.

2 years agoMATRIX: Improve error messages.
Ben Pfaff [Sun, 20 Nov 2022 00:58:49 +0000 (16:58 -0800)]
MATRIX: Improve error messages.

2 years agoEXAMINE: Improve error messages and coding style.
Ben Pfaff [Fri, 11 Nov 2022 17:38:50 +0000 (09:38 -0800)]
EXAMINE: Improve error messages and coding style.

2 years agoexpressions: Minor error message improvement.
Ben Pfaff [Thu, 17 Nov 2022 22:37:31 +0000 (14:37 -0800)]
expressions: Minor error message improvement.

2 years agopool: Support null 'pool' argument in pool_vasprintf().
Ben Pfaff [Fri, 11 Nov 2022 17:40:33 +0000 (09:40 -0800)]
pool: Support null 'pool' argument in pool_vasprintf().

Other similar functions support a null 'pool', so this function should too.

2 years agoDESCRIPTIVES: Improve error messages and coding style.
Ben Pfaff [Fri, 11 Nov 2022 06:17:21 +0000 (22:17 -0800)]
DESCRIPTIVES: Improve error messages and coding style.

2 years agoCTABLES: Improve error messages.
Ben Pfaff [Fri, 11 Nov 2022 06:15:18 +0000 (22:15 -0800)]
CTABLES: Improve error messages.

2 years agoCROSSTABS: Improve error messages and coding style.
Ben Pfaff [Fri, 11 Nov 2022 06:13:32 +0000 (22:13 -0800)]
CROSSTABS: Improve error messages and coding style.

2 years agoCORRELATIONS: Improve error messages and coding style.
Ben Pfaff [Fri, 11 Nov 2022 06:12:04 +0000 (22:12 -0800)]
CORRELATIONS: Improve error messages and coding style.

2 years agoVECTOR: Improve error messages and coding style.
Ben Pfaff [Fri, 11 Nov 2022 06:06:26 +0000 (22:06 -0800)]
VECTOR: Improve error messages and coding style.

2 years agovariable-display: Improve coding style and error messages.
Ben Pfaff [Fri, 11 Nov 2022 06:04:12 +0000 (22:04 -0800)]
variable-display: Improve coding style and error messages.

2 years agoSORT VARIABLES: Improve error messages.
Ben Pfaff [Fri, 11 Nov 2022 05:50:26 +0000 (21:50 -0800)]
SORT VARIABLES: Improve error messages.

2 years agoMRSETS: Improve error messages.
Ben Pfaff [Fri, 11 Nov 2022 05:48:34 +0000 (21:48 -0800)]
MRSETS: Improve error messages.

2 years agoMATRIX DATA: Improve error messages.
Ben Pfaff [Thu, 10 Nov 2022 15:35:01 +0000 (07:35 -0800)]
MATRIX DATA: Improve error messages.

2 years agoREREAD: Improve error messages and coding style.
Ben Pfaff [Mon, 7 Nov 2022 03:09:16 +0000 (19:09 -0800)]
REREAD: Improve error messages and coding style.

2 years agoDATASET: Improve error messages and coding style.
Ben Pfaff [Sun, 6 Nov 2022 19:54:48 +0000 (11:54 -0800)]
DATASET: Improve error messages and coding style.

2 years agoFILE HANDLE: Improve error messages and coding style.
Ben Pfaff [Sun, 6 Nov 2022 19:52:58 +0000 (11:52 -0800)]
FILE HANDLE: Improve error messages and coding style.

2 years agoGET DATA: Improve coding style and tests.
Ben Pfaff [Sun, 6 Nov 2022 19:33:59 +0000 (11:33 -0800)]
GET DATA: Improve coding style and tests.

2 years agoCORRELATIONS: Rename cmd_correlation() to cmd_correlations() for consistency.
Ben Pfaff [Sun, 6 Nov 2022 19:28:59 +0000 (11:28 -0800)]
CORRELATIONS: Rename cmd_correlation() to cmd_correlations() for consistency.

2 years agoUse lex_error_expecting() in more places.
Ben Pfaff [Sun, 6 Nov 2022 19:41:06 +0000 (11:41 -0800)]
Use lex_error_expecting() in more places.

2 years agofile-handle-def: Style improvements.
Ben Pfaff [Sun, 6 Nov 2022 19:27:59 +0000 (11:27 -0800)]
file-handle-def: Style improvements.

2 years agolexer: New function lex_force_match_phrase().
Ben Pfaff [Sun, 25 Sep 2022 23:01:26 +0000 (16:01 -0700)]
lexer: New function lex_force_match_phrase().

2 years agospvxml-helpers: Avoid warning on recent versions of libxml2.
Ben Pfaff [Sun, 6 Nov 2022 18:42:51 +0000 (10:42 -0800)]
spvxml-helpers: Avoid warning on recent versions of libxml2.

2 years agoformat: Improve error messages.
Ben Pfaff [Wed, 21 Sep 2022 23:32:26 +0000 (16:32 -0700)]
format: Improve error messages.

2 years agodocs: Improve example in DEFINE.
Ben Pfaff [Wed, 21 Sep 2022 23:29:46 +0000 (16:29 -0700)]
docs: Improve example in DEFINE.

2 years agoDATA LIST: Improve error messages and coding style.
Ben Pfaff [Wed, 21 Sep 2022 23:29:32 +0000 (16:29 -0700)]
DATA LIST: Improve error messages and coding style.

2 years agoLOOP: Improve error messages and coding style.
Ben Pfaff [Wed, 21 Sep 2022 23:33:32 +0000 (16:33 -0700)]
LOOP: Improve error messages and coding style.

2 years agoDO REPEAT: Improve error messages and coding style.
Ben Pfaff [Wed, 21 Sep 2022 22:31:54 +0000 (15:31 -0700)]
DO REPEAT: Improve error messages and coding style.

2 years agoRECODE: Improve error messages and coding style.
Ben Pfaff [Tue, 20 Sep 2022 06:13:16 +0000 (23:13 -0700)]
RECODE: Improve error messages and coding style.

2 years agoT-TEST: Improve error messages and coding style.
Ben Pfaff [Mon, 19 Sep 2022 02:59:16 +0000 (19:59 -0700)]
T-TEST: Improve error messages and coding style.

2 years agoSORT CASES: Improve error messages and coding style.
Ben Pfaff [Mon, 19 Sep 2022 02:31:47 +0000 (19:31 -0700)]
SORT CASES: Improve error messages and coding style.

2 years agoRELIABILITY: Improve error messages and coding style.
Ben Pfaff [Mon, 19 Sep 2022 02:08:06 +0000 (19:08 -0700)]
RELIABILITY: Improve error messages and coding style.

2 years agoREGRESSION: Improve error messages and coding style.
Ben Pfaff [Mon, 19 Sep 2022 01:43:01 +0000 (18:43 -0700)]
REGRESSION: Improve error messages and coding style.

2 years agoNPAR TESTS: Improve error messages and coding style.
Ben Pfaff [Mon, 19 Sep 2022 01:15:55 +0000 (18:15 -0700)]
NPAR TESTS: Improve error messages and coding style.

2 years agoMATRIX: Improve error messages.
Ben Pfaff [Sun, 18 Sep 2022 23:47:58 +0000 (16:47 -0700)]
MATRIX: Improve error messages.

2 years agoGLM: Improve error messages.
Ben Pfaff [Sun, 18 Sep 2022 23:47:49 +0000 (16:47 -0700)]
GLM: Improve error messages.

2 years agoFREQUENCIES: Improve error message and coding style.
Ben Pfaff [Sun, 18 Sep 2022 23:42:40 +0000 (16:42 -0700)]
FREQUENCIES: Improve error message and coding style.

2 years agolexer: Make lex_error_expecting_valist() support a longer list.
Ben Pfaff [Sun, 18 Sep 2022 23:42:26 +0000 (16:42 -0700)]
lexer: Make lex_error_expecting_valist() support a longer list.

2 years agoFACTOR: Improve error messages and coding style.
Ben Pfaff [Sun, 18 Sep 2022 21:08:28 +0000 (14:08 -0700)]
FACTOR: Improve error messages and coding style.

2 years agoEXAMINE: Improve error messages.
Ben Pfaff [Sun, 18 Sep 2022 21:08:20 +0000 (14:08 -0700)]
EXAMINE: Improve error messages.

2 years agoNUMERIC, STRING, LEAVE: Improve error messages.
Ben Pfaff [Sun, 18 Sep 2022 20:07:13 +0000 (13:07 -0700)]
NUMERIC, STRING, LEAVE: Improve error messages.

2 years agoRENAME VARIABLES: Remove obsolete comment.
Ben Pfaff [Sun, 18 Sep 2022 19:34:19 +0000 (12:34 -0700)]
RENAME VARIABLES: Remove obsolete comment.

2 years agoMODIFY VARS: Remove.
Ben Pfaff [Sun, 18 Sep 2022 19:33:03 +0000 (12:33 -0700)]
MODIFY VARS: Remove.

2 years agoMISSING VALUES: Improve error messages.
Ben Pfaff [Sat, 17 Sep 2022 16:43:42 +0000 (09:43 -0700)]
MISSING VALUES: Improve error messages.

2 years agoDELETE VARIABLES: Improve error messages.
Ben Pfaff [Fri, 16 Sep 2022 23:14:34 +0000 (16:14 -0700)]
DELETE VARIABLES: Improve error messages.

2 years agoAPPLY DICTIONARY: Style improvements.
Ben Pfaff [Fri, 16 Sep 2022 23:08:25 +0000 (16:08 -0700)]
APPLY DICTIONARY: Style improvements.

2 years agoSAVE TRANSLATE: Improve error messages and implementation of RENAME.
Ben Pfaff [Tue, 13 Sep 2022 02:19:38 +0000 (19:19 -0700)]
SAVE TRANSLATE: Improve error messages and implementation of RENAME.

2 years agoPRINT: Improve error messages.
Ben Pfaff [Tue, 13 Sep 2022 01:48:46 +0000 (18:48 -0700)]
PRINT: Improve error messages.

2 years agoplacement-parser: Improve error messages for format assignment.
Ben Pfaff [Mon, 12 Sep 2022 17:33:13 +0000 (10:33 -0700)]
placement-parser: Improve error messages for format assignment.

2 years agoPRINT SPACE: Improve error messages.
Ben Pfaff [Mon, 12 Sep 2022 16:34:59 +0000 (09:34 -0700)]
PRINT SPACE: Improve error messages.

2 years agoMATRIX DATA: Improve error messages.
Ben Pfaff [Mon, 12 Sep 2022 06:01:53 +0000 (23:01 -0700)]
MATRIX DATA: Improve error messages.

2 years agoLIST: Improve error messages.
Ben Pfaff [Mon, 12 Sep 2022 05:51:13 +0000 (22:51 -0700)]
LIST: Improve error messages.

2 years agoSET: Improve error messages for SET CCx.
Ben Pfaff [Mon, 12 Sep 2022 05:33:15 +0000 (22:33 -0700)]
SET: Improve error messages for SET CCx.

2 years agoImprove error messages for format specifiers.
Ben Pfaff [Mon, 12 Sep 2022 05:10:40 +0000 (22:10 -0700)]
Improve error messages for format specifiers.

2 years agoMATCH FILES, UPDATE, ADD FILES: Improve error messages.
Ben Pfaff [Mon, 12 Sep 2022 03:50:33 +0000 (20:50 -0700)]
MATCH FILES, UPDATE, ADD FILES: Improve error messages.

2 years agoSHOW: Display settings in pivot table.
Ben Pfaff [Mon, 12 Sep 2022 01:30:51 +0000 (18:30 -0700)]
SHOW: Display settings in pivot table.

2 years agoAssorted improvements to diagnostics.
Ben Pfaff [Mon, 12 Sep 2022 00:30:07 +0000 (17:30 -0700)]
Assorted improvements to diagnostics.

2 years agoINSERT: Add testing-only feature for ignoring cascading failures.
Ben Pfaff [Mon, 12 Sep 2022 00:24:42 +0000 (17:24 -0700)]
INSERT: Add testing-only feature for ignoring cascading failures.

This makes it easier to write tests that cause a lot of cascading failures.

2 years agoAGGREGATE: Bring up to speed.
Ben Pfaff [Sun, 11 Sep 2022 19:23:10 +0000 (12:23 -0700)]
AGGREGATE: Bring up to speed.

2 years agoDEFINE: Don't label a declaration, for C99 compatibility.
Ben Pfaff [Sun, 11 Sep 2022 19:08:43 +0000 (12:08 -0700)]
DEFINE: Don't label a declaration, for C99 compatibility.

Thanks to Friedrich Beckmann for reporting the problem.

Fixes: 36fc62cea799 ("macro: Coding style improvement in macro_tokens_from_string().")Fixes: b8f7ae6610f0 ("DEFINE: Improve error messages for parsing macro body.")
2 years agoAGGREGATE: Improve stats accumulation data structure.
Ben Pfaff [Sun, 11 Sep 2022 19:04:09 +0000 (12:04 -0700)]
AGGREGATE: Improve stats accumulation data structure.

2 years agostr: Replace ss_alloc_substring() by ss_clone() and similarly with a pool.
Ben Pfaff [Sun, 11 Sep 2022 18:40:02 +0000 (11:40 -0700)]
str: Replace ss_alloc_substring() by ss_clone() and similarly with a pool.

This makes it possible to use in an initializer.

2 years agoAGGREGATE: Use array instead of linked list.
Ben Pfaff [Sun, 11 Sep 2022 18:12:21 +0000 (11:12 -0700)]
AGGREGATE: Use array instead of linked list.

2 years agoAGGREGATE: Remove write-only struct member.
Ben Pfaff [Sun, 11 Sep 2022 18:10:11 +0000 (11:10 -0700)]
AGGREGATE: Remove write-only struct member.

2 years agomacro: Coding style improvement in macro_tokens_from_string().
Ben Pfaff [Sun, 11 Sep 2022 03:55:25 +0000 (20:55 -0700)]
macro: Coding style improvement in macro_tokens_from_string().

2 years agovalue: Update comments.
Ben Pfaff [Sun, 11 Sep 2022 16:31:19 +0000 (09:31 -0700)]
value: Update comments.

These used to be true but they no longer are, so remove them.

2 years agosegment: Comment fix.
Ben Pfaff [Sun, 11 Sep 2022 03:55:06 +0000 (20:55 -0700)]
segment: Comment fix.

2 years agoDEFINE: Improve error messages for parsing macro body.
Ben Pfaff [Sun, 11 Sep 2022 01:23:09 +0000 (18:23 -0700)]
DEFINE: Improve error messages for parsing macro body.

Without this change, errors always got reported following the macro body,
not for the particular token at issue.

2 years agoImprove error messages for missing subcommands.
Ben Pfaff [Sun, 11 Sep 2022 01:11:18 +0000 (18:11 -0700)]
Improve error messages for missing subcommands.

2 years agoformat: Cite variable names in messages reporting incompatible width.
Ben Pfaff [Sat, 10 Sep 2022 18:12:33 +0000 (11:12 -0700)]
format: Cite variable names in messages reporting incompatible width.

2 years agoCite tokens when reporting invalid identifiers.
Ben Pfaff [Sat, 10 Sep 2022 18:04:21 +0000 (11:04 -0700)]
Cite tokens when reporting invalid identifiers.

These functions weren't able to cite a specific token in cases where that
was appropriate.  This fixes the problem.

2 years agoImprove error messages by citing syntax in more of them.
Ben Pfaff [Mon, 29 Aug 2022 17:02:48 +0000 (10:02 -0700)]
Improve error messages by citing syntax in more of them.

A while back, PSPP gained the ability to cite particular tokens in
diagnostics, but few of the existing messages were enhanced to do
so.  This commit adds this to several more of them, in particular
all of the messages that used lex_error() and variations.

2 years agoCTABLES: Allow CAPTIONS, CORNERS, TITLES in TITLES subcommand.
Ben Pfaff [Wed, 7 Sep 2022 15:27:54 +0000 (08:27 -0700)]
CTABLES: Allow CAPTIONS, CORNERS, TITLES in TITLES subcommand.

Matthias Faeth reported that SPSS accepts these spellings.

2 years agopspp-dump-sav: Do not install by default.
Ben Pfaff [Mon, 5 Sep 2022 16:55:08 +0000 (09:55 -0700)]
pspp-dump-sav: Do not install by default.

People keep fuzzing pspp-dump-sav and reporting vulnerabilities against it,
but hardly anyone uses it (maybe just me).  It's not worth the trouble.

Fixes: #62977.
2 years agoCTABLES: Make ID values reproducible when category labels are moved.
Ben Pfaff [Sun, 28 Aug 2022 23:23:46 +0000 (16:23 -0700)]
CTABLES: Make ID values reproducible when category labels are moved.

ID values were assigned in an arbitrary order when category labels were
moved, because the pivot table leaf index for the category dimension was
not included in the sort.  This fixes the problem.

This also factors finding the category leaf index out of the inner loop in
ctables_table_output().  This index doesn't vary across that inner loop and
I simply hadn't noticed while writing the code.

2 years agoImplement CTABLES procedure. ctables17
Ben Pfaff [Mon, 27 Dec 2021 00:01:47 +0000 (16:01 -0800)]
Implement CTABLES procedure.

2 years agolexer: New function lex_ofs_error().
Ben Pfaff [Sun, 28 Aug 2022 21:19:50 +0000 (14:19 -0700)]
lexer: New function lex_ofs_error().

2 years agomessage: New function msg_location_merged().
Ben Pfaff [Sun, 28 Aug 2022 21:18:48 +0000 (14:18 -0700)]
message: New function msg_location_merged().

2 years agoFREQUENCIES: Implement LAYERED option on SPLIT FILE.
Ben Pfaff [Sat, 6 Aug 2022 19:32:01 +0000 (12:32 -0700)]
FREQUENCIES: Implement LAYERED option on SPLIT FILE.

2 years agopivot-table: Introduce infrastructure for handling split files.
Ben Pfaff [Sun, 28 Aug 2022 17:38:36 +0000 (10:38 -0700)]
pivot-table: Introduce infrastructure for handling split files.

This will be used for the first time in FREQUENCIES in an upcoming commit.

2 years agopivot-table: Allow all pivot_value formatting functions to use defaults.
Ben Pfaff [Fri, 12 Aug 2022 17:15:33 +0000 (10:15 -0700)]
pivot-table: Allow all pivot_value formatting functions to use defaults.

2 years agodictionary: Limit split file variables to 8, for compatibility.
Ben Pfaff [Sat, 6 Aug 2022 19:31:40 +0000 (12:31 -0700)]
dictionary: Limit split file variables to 8, for compatibility.

2 years agodictionary: Introduce SPLIT_NONE for dictionaries without split variables.
Ben Pfaff [Sat, 6 Aug 2022 17:55:12 +0000 (10:55 -0700)]
dictionary: Introduce SPLIT_NONE for dictionaries without split variables.

This also implements dict_get_split_type(), which previously had a
prototype but no implementation.

2 years agodictionary: New function var_force_valid_weight().
Ben Pfaff [Sun, 28 Aug 2022 21:14:35 +0000 (14:14 -0700)]
dictionary: New function var_force_valid_weight().

2 years agoAutomatically infer variables' measurement level from format and data.
Ben Pfaff [Fri, 29 Jul 2022 21:09:59 +0000 (14:09 -0700)]
Automatically infer variables' measurement level from format and data.

2 years agoUse rsvg-convert instead of GIMP for converting SVG to PNG.
Ben Pfaff [Wed, 3 Aug 2022 23:53:53 +0000 (16:53 -0700)]
Use rsvg-convert instead of GIMP for converting SVG to PNG.

rsvg-convert is much faster and more commonly installed.

2 years agostr: New functions for case-matching of substrings, prefixes, and suffixes.
Ben Pfaff [Sun, 28 Aug 2022 21:20:22 +0000 (14:20 -0700)]
str: New functions for case-matching of substrings, prefixes, and suffixes.

2 years agostr: New function ds_put_substring_multiple().
Ben Pfaff [Mon, 1 Aug 2022 04:18:21 +0000 (21:18 -0700)]
str: New function ds_put_substring_multiple().

2 years agolexer: Fix negative 'n0' and 'n1' in lex_source_contains_macro_call().
Ben Pfaff [Mon, 1 Aug 2022 04:16:49 +0000 (21:16 -0700)]
lexer: Fix negative 'n0' and 'n1' in lex_source_contains_macro_call().