From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ben Pfaff Newsgroups: gmane.emacs.devel,gmane.comp.statistics.pspp.devel Subject: Re: Fwd: [ELPA] New package: pspp-mode.el for PSPP/SPSS syntax highlighting Date: Sun, 5 Jul 2020 10:16:19 -0700 Message-ID: References: <4836167B-33A9-46A3-B586-20768E333E1D@gmx.de> <20200704151535.GA31917@jocasta.intra> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20831"; mail-complaints-to="usenet@ciao.gmane.io" Cc: PSPP Development Mailing List , mail@vasilij.de, John Darrington , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jul 05 19:26:35 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1js8PT-0005KC-Iz for ged-emacs-devel@m.gmane-mx.org; Sun, 05 Jul 2020 19:26:35 +0200 Original-Received: from localhost ([::1]:51942 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1js8PS-0006aL-GZ for ged-emacs-devel@m.gmane-mx.org; Sun, 05 Jul 2020 13:26:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35804) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1js8Fr-0003L5-He; Sun, 05 Jul 2020 13:16:39 -0400 Original-Received: from smtp2.cs.stanford.edu ([171.64.64.26]:43018) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1js8Fp-0008HG-Ud; Sun, 05 Jul 2020 13:16:39 -0400 Original-Received: from mail-il1-f179.google.com ([209.85.166.179]:35045) by smtp2.cs.Stanford.EDU with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.3) (envelope-from ) id 1js8Fn-0004JJ-1I; Sun, 05 Jul 2020 10:16:35 -0700 Original-Received: by mail-il1-f179.google.com with SMTP id t18so11103039ilh.2; Sun, 05 Jul 2020 10:16:35 -0700 (PDT) X-Gm-Message-State: AOAM530W2I+2owoQNYRE4lCz3dLAVbxzS5002lIVxZzQLHTzyitCwqfq C4lsLQZBV0P+bywSkp2PBsyMVSbEixvWt1whfMA= X-Google-Smtp-Source: ABdhPJxfYiMvgOq31o4FX4h49wIdjQVaW0DIJFmu5ftJh5dkVGY4/3cDI3YiCrg8Yvw9/FFOoN5dVqYxTAI5Lq/HPfc= X-Received: by 2002:a92:bb84:: with SMTP id x4mr27690169ilk.177.1593969394541; Sun, 05 Jul 2020 10:16:34 -0700 (PDT) In-Reply-To: X-Gmail-Original-Message-ID: X-Scan-Signature: 993826b9125cbf1b907f71dc54053338 Received-SPF: pass client-ip=171.64.64.26; envelope-from=blp@cs.stanford.edu; helo=smtp2.cs.Stanford.EDU X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/05 13:16:35 X-ACL-Warn: Detected OS = Linux 3.1-3.10 X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Mailman-Approved-At: Sun, 05 Jul 2020 13:24:39 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:252711 gmane.comp.statistics.pspp.devel:7580 Archived-At: On Sat, Jul 4, 2020 at 3:46 PM Stefan Monnier 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.