Ben Pfaff [Mon, 5 Jul 2021 20:46:32 +0000 (13:46 -0700)]
configure: Enable GCC warnings to report use of C2x features.
One C2x feature in GCC 11 is the reason that the previous commit afda22462a88 ("Fix broken build due to missing braces") was needed by
some developers.
Ben Pfaff [Sun, 4 Jul 2021 05:00:47 +0000 (22:00 -0700)]
segment: Distinguish snippets from full files.
The comment on segmenter_init() explains what this means:
If IS_SNIPPET is false, then the segmenter will parse as if it's being
given a whole file. This means, for example, that it will interpret -
or + at the beginning of the syntax as a separator between commands
(since - or + at the beginning of a line has this meaning).
If IS_SNIPPET is true, then the segmenter will parse as if it's being
given an isolated piece of syntax. This means that, for example, that
it will interpret - or + at the beginning of the syntax as an operator
token or (if followed by a digit) as part of a number.
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.