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: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 [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: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 [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.
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.
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.
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 [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 [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().
Ben Pfaff [Sun, 7 Feb 2021 03:52:24 +0000 (19:52 -0800)]
spvbin-helpers: Properly handle parsing strings with no destination.
binary-parser-generator will pass a null pointer to spvbin_parse_string()
or spvbin_parse_bestring() for a string that should be parsed but not
stored. In such a case, the implementation would dereference a null
pointer. This fixes the problem.
This is only a theoretical problem because the grammars PSPP uses now
always store the strings that they parse.
Ben Pfaff [Mon, 25 Jan 2021 05:09:08 +0000 (21:09 -0800)]
output: Replace OUTPUT_ITEM_PAGE_SETUP by a new driver function.
OUTPUT_ITEM_PAGE_SETUP was a special case that only the Cairo and SPV
drivers could implement, and it could only come first in the output stream
anyway, so it didn't make much sense. This commit gets rid of it in favor
of adding a new driver class function for setting the page setup.
Ben Pfaff [Thu, 14 Jan 2021 06:05:05 +0000 (22:05 -0800)]
output: Make groups contain their subitems, and get rid of spv_item.
Until now, the output subsystem has had two different ideas for output
items: struct output_item, which is the primary representation, and
struct spv_item, which represents an output item read from an .spv file.
The biggest difference, until now, has been that spv_item contains its
children, whereas output_item bracketed children inside open/close pairs.
This commit unifies them under output_item, making output_item adopt the
container abstraction.