Ben Pfaff [Mon, 10 May 2021 05:37:17 +0000 (22:37 -0700)]
!quote, !unquote
Ben Pfaff [Mon, 10 May 2021 03:41:06 +0000 (20:41 -0700)]
work on macro functions
Ben Pfaff [Sun, 9 May 2021 21:59:16 +0000 (14:59 -0700)]
now macros keep track of representation
Ben Pfaff [Mon, 3 May 2021 06:10:47 +0000 (23:10 -0700)]
!LENGTH and !BLANKS work
Ben Pfaff [Mon, 3 May 2021 05:08:37 +0000 (22:08 -0700)]
Macro arguments and the !length function work.
Ben Pfaff [Sun, 2 May 2021 20:02:41 +0000 (13:02 -0700)]
Most basic macros work.
Ben Pfaff [Sat, 1 May 2021 22:47:33 +0000 (15:47 -0700)]
work on macros
Ben Pfaff [Mon, 19 Apr 2021 00:36:34 +0000 (17:36 -0700)]
work on macro calls
Ben Pfaff [Sun, 18 Apr 2021 20:48:53 +0000 (13:48 -0700)]
Break macro structure definition into new file.
Ben Pfaff [Tue, 23 Mar 2021 14:14:48 +0000 (07:14 -0700)]
DEFINE command can now be parsed.
Ben Pfaff [Sun, 30 May 2021 20:31:39 +0000 (13:31 -0700)]
segment: Refine treatment of start of macro body.
Previously, if the first line of the macro body (the same line as the
closing parenthesis in the DEFINE) was blank, we reported it as a blank
line to the lexer. The parser for DEFINE could check for that (by seeing
whether the first line of macro body was empty or all-spaces) but it seems
more elegant to do it in the segmenter. This implements that.
Ben Pfaff [Sun, 30 May 2021 20:30:10 +0000 (13:30 -0700)]
segment: Fix implementation of is_all_spaces().
Ben Pfaff [Sun, 30 May 2021 20:00:24 +0000 (13:00 -0700)]
segment: The body of DEFINE does not have to be on separate lines.
Some examples of one-line DEFINE can be seen at:
https://www.spsstools.net/en/macros/macros-index/utilities/quote-string-on-the-fly/
such as:
DEFINE !client() ABC Inc !ENDDEFINE.
Ben Pfaff [Sun, 30 May 2021 19:49:45 +0000 (12:49 -0700)]
segment-test: Make debugging easier for some kinds of test failures.
Ben Pfaff [Sun, 9 May 2021 22:01:34 +0000 (15:01 -0700)]
token: Rename token_destroy() to token_uninit().
This better fits the convention that "destroy" functions free the argument,
whereas "uninit" frees only the members of the argument structure.
Ben Pfaff [Mon, 3 May 2021 00:13:27 +0000 (17:13 -0700)]
lexer: Remove lex_syntax_mode in favor of segmenter_mode.
These two enums have the same meaning and there was no benefit to having
both of them plus translation back and forth.
John Darrington [Sun, 2 May 2021 08:29:07 +0000 (10:29 +0200)]
po/hu.po: Update to lastest version from translation-project.org
Ben Pfaff [Sat, 1 May 2021 23:39:15 +0000 (16:39 -0700)]
psppire-output-view: Avoid doubling output when exporting or printing.
Outputting a group outputs its contents, but the code here was also
separately outputing the contents, which effectively doubled it. (PSPP
doesn't currently use nested groups but these would have led to additional
copies.)
This fixes the problem by only printing items that aren't nested inside
any group.
Bug #60464.
Thanks to John Darrington for reporting this bug.
Ben Pfaff [Sat, 1 May 2021 22:54:18 +0000 (15:54 -0700)]
box-whisker: Use consistent array size for box_whisker_hinges().
The prototype said the 'hinges' parameter has 2 elements but the definition
said that it has 3. This fixes the prototype.
This is harmless because the C standard says these are actually equivalent.
Reported by GCC 11.
Ben Pfaff [Sat, 1 May 2021 22:53:09 +0000 (15:53 -0700)]
format-parser: Fix inconsistent use of "char *" vs "char[NUMBER]".
These are equivalent according to the C standard in function prototypes,
but GCC 11 warns about using them inconsistently between a prototype and
a definition. This commit avoids the warning.
John Darrington [Sat, 1 May 2021 12:08:27 +0000 (14:08 +0200)]
src/language/utilities/host.c (run_command): Fix memory leak
John Darrington [Sat, 1 May 2021 11:55:35 +0000 (13:55 +0200)]
src/data/format.c (fmt_affix_free): Fix memory leak
John Darrington [Sat, 1 May 2021 06:27:46 +0000 (08:27 +0200)]
src/output/tex.c (post_process_tokens): Fix memory leak
John Darrington [Sat, 1 May 2021 05:45:09 +0000 (07:45 +0200)]
src/output/select.c (select_matches): Fix memory leak
John Darrington [Sat, 1 May 2021 05:35:50 +0000 (07:35 +0200)]
src/output/spv/spv.c (spv_read): Remove unused variable
John Darrington [Sat, 1 May 2021 05:31:34 +0000 (07:31 +0200)]
src/output/output-item.c (output_item_unref): Fix memory leak
John Darrington [Sat, 1 May 2021 05:30:14 +0000 (07:30 +0200)]
src/output/output-item.h (outpt_item_ref): Add WARN_UNUSED_RESULT attribute
John Darrington [Sat, 1 May 2021 05:29:24 +0000 (07:29 +0200)]
src/ouput/output-item.c (output_item_unshare): Use result of output_item_ref
John Darrington [Sat, 1 May 2021 05:17:29 +0000 (07:17 +0200)]
src/output/pivot-table.c (pivot_value_ex_destroy): Fix memory leak
John Darrington [Sun, 18 Apr 2021 05:06:54 +0000 (07:06 +0200)]
Windows/automake.mk: Use more portable code
* Windows/automake.mk (environment_dir): Avoid GNU Make extensions
* Windows/automake.mk (libgcc_dir): Avoid GNU Make extensions
Suggested-by: Ben Praff <blp@gnu.org>
Ben Pfaff [Sun, 18 Apr 2021 19:54:18 +0000 (12:54 -0700)]
lexer: Fix typo in comment.
John Darrington [Sun, 18 Apr 2021 18:21:29 +0000 (20:21 +0200)]
Output drivers: Remove assertions on OUTPUT_ITEM_GROUP
This case was indeed not reached when run from the command line, but certainly
was when exporting from the output viewer.
John Darrington [Sun, 18 Apr 2021 11:08:41 +0000 (13:08 +0200)]
Added rules to build nsis installers for w32
* Windows/AdvUninstLog.nsh: New file.
* Windows/MUI_EXTRAPAGES.nsh: New file.
* Windows/automake.mk: New file.
* Windows/pspp.nsi: New file.
* Makefile.am: include Windows/automake.mk.
* configure.ac: Add conditional for sizeof ptr.
John Darrington [Sun, 18 Apr 2021 06:38:48 +0000 (08:38 +0200)]
Added a script to assist building for w32
* Windows/README: New file.
* Windows/build-dependencies: New file.
Ben Pfaff [Tue, 13 Apr 2021 20:43:05 +0000 (13:43 -0700)]
Refactor SET and SHOW commands so it's harder to forget implementing SHOW.
Ben Pfaff [Tue, 13 Apr 2021 19:17:01 +0000 (12:17 -0700)]
settings: Add macro settings.
Ben Pfaff [Tue, 13 Apr 2021 18:56:49 +0000 (11:56 -0700)]
settings: Use modern initializer style.
Ben Pfaff [Tue, 13 Apr 2021 17:35:02 +0000 (10:35 -0700)]
segment: Allow '.' as separate token with a line, for macros.
The description of macros just says that ^ and \ can't be used as macro
delimiters, so . is probably OK.
Ben Pfaff [Tue, 13 Apr 2021 17:01:58 +0000 (10:01 -0700)]
psppire-dialog-action-regression: Fix unused variable warning.
GCC said that 'ok' was unused because it's declared in the 'for' loop.
Ben Pfaff [Tue, 13 Apr 2021 16:58:46 +0000 (09:58 -0700)]
segment: Improve segmentation when DEFINE command has early terminator.
The DEFINE command should not have a command terminator before the final
!ENDDEFINE. When it does, that ends the whole thing early. The segmenter
didn't handle this well, instead treating everything up to !ENDDEFINE as
part of the command. That's probably not the best way because it makes
for confusing error messages. This improves the behavior.
John Darrington [Sat, 10 Apr 2021 07:05:31 +0000 (09:05 +0200)]
doc/automake: Use correct syntax for configuring native build
John Darrington [Sat, 10 Apr 2021 07:03:18 +0000 (09:03 +0200)]
Add w32 handler for "activate-link" signal
The default activate-link handler for GtkAboutDialog does not seem to work on
w32. So this change implements a special one.
src/ui/gui/help-menu.c (about-new): Add signal handler
John Darrington [Sat, 10 Apr 2021 06:31:48 +0000 (08:31 +0200)]
Remove unused module subcommand-list
John Darrington [Sat, 10 Apr 2021 06:24:47 +0000 (08:24 +0200)]
tests/automake.mk: Fix building of test runners
For certain architectures, the order of libraries is important. Dependent
libraries must appear before the libraries which depend upon them.
John Darrington [Sat, 10 Apr 2021 06:10:08 +0000 (08:10 +0200)]
src/ui/gui/var-display.c (missing_values_to_string): Reduce scope of local variable.
John Darrington [Sat, 10 Apr 2021 06:09:09 +0000 (08:09 +0200)]
src/ui/gui/psppire-output-view.c (psppire_output_view_new): Reduce scope of local variables.
John Darrington [Sat, 10 Apr 2021 06:08:15 +0000 (08:08 +0200)]
src/ui/gui/psppire-dict.c (psppire_dict_set_name): Reduce scope of local variable.
John Darrington [Sat, 10 Apr 2021 06:06:41 +0000 (08:06 +0200)]
src/ui/gui/psppire-dialog-action-regression.c (generate_syntax): Reduce scope of local variables.
John Darrington [Sat, 10 Apr 2021 06:04:39 +0000 (08:04 +0200)]
src/ui/gui/psppire-data-store.c (psppire_data_store_get_reader): Reduce scope of local variable.
John Darrington [Sat, 10 Apr 2021 06:03:26 +0000 (08:03 +0200)]
src/libpspp/float-format.c (extract_hex): Remove useless assignment.
Found by cppcheck.
John Darrington [Sat, 10 Apr 2021 06:00:55 +0000 (08:00 +0200)]
src/language/stats/crosstabs.c (display_risk): Avoid warning found by cppcheck
Ben Pfaff [Fri, 9 Apr 2021 18:24:44 +0000 (11:24 -0700)]
command: DEFINE command is still unimplemented.
Commit
ed109bf49821 ("lexer: Add support for macro punctuation.")
mistakenly changed this.
Ben Pfaff [Fri, 9 Apr 2021 17:53:33 +0000 (10:53 -0700)]
lexer: Add support for DEFINE...!ENDDEFINE.
This doesn't support the command itself, just the lexical analysis needed
for it.
Ben Pfaff [Mon, 22 Mar 2021 06:06:14 +0000 (23:06 -0700)]
lexer: Add support for macro punctuation.
These punctuation symbols can be used to delimit macro arguments, even
though they aren't allowed anywhere else in the language.
Ben Pfaff [Sun, 21 Mar 2021 21:58:09 +0000 (14:58 -0700)]
lexer: Add support for macro identifiers (that begin with '!').
Ben Pfaff [Fri, 9 Apr 2021 17:32:18 +0000 (10:32 -0700)]
segment: Fix segmentation of integer followed by "." at end of file.
Previously this was segmented as a single number containing a trailing dot,
but it should be an integer followed by end-of-command.
John Darrington [Sun, 4 Apr 2021 18:08:42 +0000 (20:08 +0200)]
Mention Harry Thijssen in THANKS
John Darrington [Sat, 3 Apr 2021 07:42:37 +0000 (09:42 +0200)]
src/ui/gui/help-menu.c (open_windows_help): Reimplement
This change reimplements the function open_windows_help, because:
1. It didn't seem to work reliably.
2. It seems overly complicated.
3. It relied upon a binary called "wscript.exe" which according to
a brief web search, many windows users consider a security hole
and routinely remove it.
John Darrington [Sun, 4 Apr 2021 16:38:22 +0000 (18:38 +0200)]
src/language/stats/glm.c: Fix compiler warnings
John Darrington [Sat, 3 Apr 2021 12:32:56 +0000 (14:32 +0200)]
src/libpspp/message.c (prepare_diagnostic_information): Relocate locale_dir
John Darrington [Sun, 28 Mar 2021 16:39:44 +0000 (18:39 +0200)]
Output Window: Fix sensitivity of Save button. Also add option for png and svg files.
src/ui/gui/psppire-output-window.c (on_combo_change): Simplify logic and use
correct limit for number of filename extentions.
John Darrington [Sun, 28 Mar 2021 09:17:16 +0000 (11:17 +0200)]
src/ui/gui/automake.mk [src_ui_gui_psppire_CFLAGS]: Compile for a GUI under w32
John Darrington [Sun, 28 Mar 2021 09:15:33 +0000 (11:15 +0200)]
src/ui/gui/psppire.c: Fold long line
John Darrington [Sat, 27 Mar 2021 18:08:26 +0000 (19:08 +0100)]
src/ui/gui/psppire-dialog-action-runs.c (generate_syntax): Rename 'text' to 'str'
John Darrington [Sat, 27 Mar 2021 17:59:18 +0000 (18:59 +0100)]
src/ui/gui/find-dialog.c (ip -> case_iterator): Rename.
John Darrington [Sat, 27 Mar 2021 17:54:05 +0000 (18:54 +0100)]
src/ui/gui/psppire.c (struct icon_size): Remove --- unused
John Darrington [Sat, 27 Mar 2021 17:53:12 +0000 (18:53 +0100)]
src/ui/gui/helper.c (clone_list_store): Remove unused variable
John Darrington [Sat, 27 Mar 2021 10:33:18 +0000 (11:33 +0100)]
Bump micro version to 1.5.3
John Darrington [Sat, 27 Mar 2021 09:26:08 +0000 (10:26 +0100)]
Generate cosmetics for windows hosts.
On w32 hosts, generate the resource file and link it to the psppire
executable. Also generate the pspp.ico which is associated with the
executable.
Ben Pfaff [Tue, 23 Mar 2021 14:14:35 +0000 (07:14 -0700)]
segment: Properly handle DO REPEAT in batch mode.
In batch mode, a line that begins with a non-blank starts a new command,
but the segmenter didn't properly support this. Without this commit,
the following wasn't properly handled:
DO REPEAT #x=1
ECHO 'hi'
END REPEAT
This commit also adds a test against regression, which also checks that
a blank line to separate DO REPEAT from the repeated syntax works (it
did before too, but there was no test).
Ben Pfaff [Mon, 22 Mar 2021 19:50:23 +0000 (12:50 -0700)]
lexer: New function lex_force_int_range().
This simplifies parsing code that needs an integer in a particular range.
John Darrington [Sun, 21 Mar 2021 21:19:25 +0000 (22:19 +0100)]
Fix bug where attempting to rendering an empty bar chart would crash
Ben Pfaff [Sun, 21 Mar 2021 19:48:01 +0000 (12:48 -0700)]
doc: Update documentation for SET command to match recent code changes.
Ben Pfaff [Sun, 21 Mar 2021 19:03:52 +0000 (12:03 -0700)]
q2c: Remove, since it is no longer used.
This was the only tool that needed the build system's C compiler, so also
remove the parts of the build system that supported that.
Ben Pfaff [Sun, 21 Mar 2021 18:59:30 +0000 (11:59 -0700)]
SET: Reimplement parser without q2c.
Ben Pfaff [Wed, 17 Mar 2021 17:50:28 +0000 (10:50 -0700)]
CROSSTABS: Reimplement parser without q2c.
John Darrington [Sun, 14 Mar 2021 18:39:30 +0000 (19:39 +0100)]
Avoid useless warnings on stderr.
src/libpspp/i18n.c (create_iconv): New argument 'warn'
John Darrington [Sun, 14 Mar 2021 15:33:31 +0000 (16:33 +0100)]
src/ui/gui/main.c: Add a startup tip for Windows
John Darrington [Sun, 14 Mar 2021 21:42:47 +0000 (22:42 +0100)]
psppire-import-spreadsheet.c: Fix typo
John Darrington [Sun, 14 Mar 2021 13:24:01 +0000 (14:24 +0100)]
src/output/spv/automake.mk: Add some explicit dependencies to help cross building
John Darrington [Sun, 14 Mar 2021 12:45:39 +0000 (13:45 +0100)]
src/language/expressions/automake.mk: Fix build issues when cross building
Ben Pfaff [Thu, 11 Mar 2021 03:53:39 +0000 (19:53 -0800)]
gui: Include line number in error messages generated from syntax windows.
Ben Pfaff [Thu, 11 Mar 2021 03:53:21 +0000 (19:53 -0800)]
gui: Label unnamed syntax windows as "Untitled" in error messages.
Seems a little more user-friendly than just omitted a filename entirely.
Ben Pfaff [Thu, 11 Mar 2021 03:42:27 +0000 (19:42 -0800)]
Add syntax mode radio button to syntax editor window.
A number of users have reported problems with the syntax mode. I am not
sure why. This should allow them to select the syntax mode they actually
need to use, just in case. The default should be unchanged (it is still
Auto).
Ben Pfaff [Tue, 9 Mar 2021 02:18:48 +0000 (18:18 -0800)]
pivot-table: Reduce size of struct pivot_value from 80 bytes to 40.
Ben Pfaff [Mon, 8 Mar 2021 06:52:43 +0000 (22:52 -0800)]
pivot-table: Reduce size of struct pivot_value from 96 bytes to 80.
Ben Pfaff [Mon, 8 Mar 2021 05:55:01 +0000 (21:55 -0800)]
format: Reduce size of struct fmt_spec from 6 bytes to 4.
Ben Pfaff [Mon, 8 Mar 2021 05:39:19 +0000 (21:39 -0800)]
format: Reduce size of struct fmt_spec from 12 bytes to 6.
Ben Pfaff [Sun, 7 Mar 2021 23:42:56 +0000 (15:42 -0800)]
DELETE VARIABLES: Fix crash when deleting and adding vars at same time.
Thanks to Ricardo Mejias for reporting the problem:
https://lists.gnu.org/archive/html/pspp-users/2021-03/msg00025.html
Ben Pfaff [Sun, 7 Mar 2021 19:33:00 +0000 (11:33 -0800)]
Improve error message for creating a new string var with COMPUTE or IF.
Ben Pfaff [Sun, 7 Mar 2021 00:39:20 +0000 (16:39 -0800)]
tests: Ignore .pspprc in a different way, to fix running TeX on Fedora.
On Fedora, the 'tex' program generates per-user formats in the user's
home directory. With the way that atlocal previously set $HOME to
/nonexistent, this failed, because formats can't be found or created in
/nonexistent. This fixes the problem by using a different way to avoid
making pspp look for .pspprc.
Ben Pfaff [Sun, 21 Feb 2021 18:32:37 +0000 (10:32 -0800)]
ascii: Always include <sys/ioctl.h> if we're calling ioctl.
This file included sys/ioctl.h if it was necessary to use the TIOCGWINSZ
constant, but in fact it's needed to call ioctl() at all, so this commit
moves the #include so that it's included whenever we use ioctl().
Bug #60069.
Reported by Jeremy Lavergne.
Ben Pfaff [Mon, 15 Feb 2021 06:42:33 +0000 (22:42 -0800)]
psppire-output-view: Remove more dead code.
Ben Pfaff [Mon, 15 Feb 2021 05:55:20 +0000 (21:55 -0800)]
psppire-output-view: Fix display of groups.
Bug introduced in commit
507ebaea3673 ("output: Make groups contain
their subitems, and get rid of spv_item.").
Reported by John Darrington.
Ben Pfaff [Mon, 15 Feb 2021 05:13:09 +0000 (21:13 -0800)]
psppire-output-view: Remove dead code.
John Darrington [Sun, 7 Feb 2021 09:03:54 +0000 (10:03 +0100)]
/ui/gui/psppire-var-info.c (__set_property): Remove redundant test.
Found by cppcheck.
John Darrington [Sun, 7 Feb 2021 09:01:14 +0000 (10:01 +0100)]
src/libpspp/zip-reader.c (probe_magic): Fix inappropriate return value.
Found by cppcheck.
John Darrington [Sun, 7 Feb 2021 09:00:06 +0000 (10:00 +0100)]
src/language/stats/autorecode.c (cmd_autorecode): Remove redundant test.
Found by cppcheck.
John Darrington [Sun, 7 Feb 2021 08:58:01 +0000 (09:58 +0100)]
src/data/sys-file-reader.c: (read_header): Remove redundant test.
Found by cppcheck.
John Darrington [Sun, 7 Feb 2021 08:54:49 +0000 (09:54 +0100)]
src/math/wilcoxon-sig.c (count_sums_to_W): Avoid use of unsigned value.
Use signed long int, not unsigned long int.
Found by cppcheck.