pspp
17 months agoCTABLES: Fix treatment of multiline titles.
Ben Pfaff [Thu, 24 Nov 2022 00:51:19 +0000 (16:51 -0800)]
CTABLES: Fix treatment of multiline titles.

Bug #63032.
Thanks to Frans Houweling for reporting this bug.

17 months agoCTABLES: Make EMPTY independent of other settings on CATEGORIES.
Ben Pfaff [Thu, 24 Nov 2022 00:39:35 +0000 (16:39 -0800)]
CTABLES: Make EMPTY independent of other settings on CATEGORIES.

Frans Houweling reported that the following two commands behave
differently:

   CTABLES /TABLE=class > datum BY size
      /CATEGORIES VARIABLES=ALL EMPTY=EXCLUDE
      /CATEGORIES VARIABLES=size TOTAL=YES.
   CTABLES /TABLE=class > datum BY size
      /CATEGORIES VARIABLES=size TOTAL=YES
      /CATEGORIES VARIABLES=ALL EMPTY=EXCLUDE.

There was a good reason for this, which is that CATEGORIES always changes
all the category attributes of whatever variables are named.  That is,
CATEGORIES VARIABLES=ALL overrides TOTAL even if EMPTY is the only
subcommand given.  I don't know what SPSS does here, but this behavior is
surprising enough that I wanted to change it.  This commit does that;
afterward, both of the above commands behave the same way, which
combines effects of TOTAL=YES and EMPTY=EXCLUDE for size and just
EMPTY=EXCLUDE for the class and datum.

18 months agoexamples: Rename variables for nhtsa example to give them better names.
Ben Pfaff [Wed, 23 Nov 2022 02:47:59 +0000 (18:47 -0800)]
examples: Rename variables for nhtsa example to give them better names.

The existing names were taken from question numbers in the questionnaire
(I guess), which weren't meaningful.  This replaces them by meaningful
names.

Thanks to Frans Houweling <fhouweling@email.it> for providing the new
names!

18 months agospv-driver: Fix memory leak on error path.
Ben Pfaff [Wed, 23 Nov 2022 01:15:22 +0000 (17:15 -0800)]
spv-driver: Fix memory leak on error path.

18 months agospv: ALlow an extra 01 at the end of X3.
Ben Pfaff [Tue, 22 Nov 2022 22:47:45 +0000 (14:47 -0800)]
spv: ALlow an extra 01 at the end of X3.

One sample received in a user report had this present.

18 months agoUPDATE: Improve a test.
Ben Pfaff [Mon, 21 Nov 2022 07:00:19 +0000 (23:00 -0800)]
UPDATE: Improve a test.

18 months agoMEANS: Improve error messages and coding style.
Ben Pfaff [Mon, 21 Nov 2022 06:25:33 +0000 (22:25 -0800)]
MEANS: Improve error messages and coding style.

18 months agoOUTPUT MODIFY: Improve error messages and coding style.
Ben Pfaff [Mon, 21 Nov 2022 06:15:11 +0000 (22:15 -0800)]
OUTPUT MODIFY: Improve error messages and coding style.

18 months agoSET: Improve error messages and coding style.
Ben Pfaff [Mon, 21 Nov 2022 00:49:55 +0000 (16:49 -0800)]
SET: Improve error messages and coding style.

18 months agoINSERT: Improve error messages and coding style.
Ben Pfaff [Mon, 21 Nov 2022 00:46:30 +0000 (16:46 -0800)]
INSERT: Improve error messages and coding style.

18 months agoROC: Improve error messages and coding style.
Ben Pfaff [Sun, 20 Nov 2022 22:14:04 +0000 (14:14 -0800)]
ROC: Improve error messages and coding style.

18 months 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.

18 months 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.

18 months 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.

18 months 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.

18 months 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.

18 months 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.

18 months 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.

18 months 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.

18 months 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.

18 months 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.

18 months 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.

18 months 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.

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

18 months 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.

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

18 months 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.

18 months 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.

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

18 months 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.

18 months 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.

18 months 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.

18 months 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.

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

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

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

18 months 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.

18 months 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.

18 months 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.

18 months 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.

18 months 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.

18 months 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.

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

18 months 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().

18 months 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.

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

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

20 months 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.

20 months 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.

20 months 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.

20 months 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.

20 months 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.

20 months 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.

20 months 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.

20 months 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.

20 months 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.

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

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

20 months 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.

20 months 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.

20 months 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.

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

20 months 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.

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

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

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

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

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

20 months 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.

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

20 months 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.

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

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

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

20 months 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.

20 months 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.

20 months 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.

20 months 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.

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

20 months 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.

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

20 months 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.")
20 months 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.

20 months 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.

20 months 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.

20 months 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.

20 months 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().

20 months 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.

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

20 months 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.

20 months 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.

20 months 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.

20 months 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.

20 months 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.

20 months 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.

20 months 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.
20 months 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.

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

20 months 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().

20 months 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().