Hi Ben, Thanks for chiming in,
> SPSS syntax is bizarre. It has two modes: "batch" and "interactive" mode. Aha! > 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. So that's the syntax that's documented in the Texinfo, and that's the syntax handled by `segmenter_parse_comment_1__`? > 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. Thanks. I guess `pspp-mode.el` should try to reproduce the same DWIMish behavior. Yet another question: do comments (either "*" or "COMMENT") always start in column 0 or can they start indented or even on the same line as some other command, as in: input program. * let's get started. > 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. Of course, I prefer it when comments are handled in the lexer rather than in the parser, so they can occur anywhere between tokens, but I expect that this boat has sailed ;-) Stefan