[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fwd: [ELPA] New package: pspp-mode.el for PSPP/SPSS syntax highlight
From: |
Ben Pfaff |
Subject: |
Re: Fwd: [ELPA] New package: pspp-mode.el for PSPP/SPSS syntax highlighting |
Date: |
Sun, 5 Jul 2020 10:16:19 -0700 |
On Sat, Jul 4, 2020 at 3:46 PM Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> But the main issue is the comment syntax. I'm trying to handle them
> right using `syntax-propertize`, but the patch can't handle the
> t-test-sps I found in PSPP's Git. I don't understand what the real
> syntax should be. The doc seems to suggest that comments start with `*`
> or `comment` (in the position of the beginning of a command?)
> and end with a `.` at an end of line or with an empty line, but in
> t-test.sps I see:
>
> * Females have gender 0
> * Create 8 female cases
> loop #i = 1 to 8.
>
> where the comment does not seem to be terminated (neither by a `.` nor
> by an empty line). What am I missing?
SPSS syntax is bizarre. It has two modes: "batch" and "interactive" mode.
A syntax file might be written in either syntax. There's no way to easily guess
which one.
In "interactive" syntax, a command ends with a line that ends with . or
with a blank line.
In "batch" syntax, a command mainly ends with a line that is not indented.
I think that a blank line also works in this syntax. I've forgotten some of
the details (although they should be documented).
PSPP can be configured to interpret files in either syntax mode. It's a pain
requiring users to do this, so by default it tries to guess on a line-by-line
basis: if a line is not indented and if it begins with keywords that are an
SPSS command name, then it assumes that it is the beginning of a command
and that the previous command ended. This is nasty also, but it works
well most of the time regardless of what syntax mode the file was written
in.
I think that's why the file above gets treated the way it does.
Maybe PSPP should treat comment commands specially. That would
be yet another special case in the lexer/parser, but maybe it is warranted.
- Re: Fwd: [ELPA] New package: pspp-mode.el for PSPP/SPSS syntax highlighting, John Darrington, 2020/07/04
- Re: [ELPA] New package: pspp-mode.el for PSPP/SPSS syntax highlighting, Friedrich Beckmann, 2020/07/05
- Re: [ELPA] New package: pspp-mode.el for PSPP/SPSS syntax highlighting, John Darrington, 2020/07/05
- Re: [ELPA] New package: pspp-mode.el for PSPP/SPSS syntax highlighting, Sean Whitton, 2020/07/05
- Re: [ELPA] New package: pspp-mode.el for PSPP/SPSS syntax highlighting, Friedrich Beckmann, 2020/07/05
- Re: [ELPA] New package: pspp-mode.el for PSPP/SPSS syntax highlighting, Sean Whitton, 2020/07/05
- Re: [ELPA] New package: pspp-mode.el for PSPP/SPSS syntax highlighting, John Darrington, 2020/07/05
- Re: [ELPA] New package: pspp-mode.el for PSPP/SPSS syntax highlighting, Sean Whitton, 2020/07/05
- Re: [ELPA] New package: pspp-mode.el for PSPP/SPSS syntax highlighting, Dmitry Alexandrov, 2020/07/06