From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stephen Leake Newsgroups: gmane.emacs.devel Subject: Re: Font Locking issue: Need help/advice Date: Fri, 03 Apr 2020 16:21:46 -0800 Message-ID: <86y2rccd7p.fsf@stephe-leake.org> References: <25fe76a8-025a-be67-8a28-3ac711f07766@protonmail.ch> <86sghke873.fsf@stephe-leake.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="104319"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (windows-nt) To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Apr 04 02:22:28 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 1jKWZv-000R2k-QC for ged-emacs-devel@m.gmane-mx.org; Sat, 04 Apr 2020 02:22:27 +0200 Original-Received: from localhost ([::1]:34052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jKWZu-0001dw-Ru for ged-emacs-devel@m.gmane-mx.org; Fri, 03 Apr 2020 20:22:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46316) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jKWZQ-0001Dt-33 for emacs-devel@gnu.org; Fri, 03 Apr 2020 20:21:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jKWZO-000571-6q for emacs-devel@gnu.org; Fri, 03 Apr 2020 20:21:55 -0400 Original-Received: from gateway34.websitewelcome.com ([192.185.149.62]:36507) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jKWZO-00050f-05 for emacs-devel@gnu.org; Fri, 03 Apr 2020 20:21:54 -0400 Original-Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway34.websitewelcome.com (Postfix) with ESMTP id 3F5FA50CA1 for ; Fri, 3 Apr 2020 19:21:52 -0500 (CDT) Original-Received: from host2007.hostmonster.com ([67.20.76.71]) by cmsmtp with SMTP id KWZLj68Pu8vkBKWZMjuSbH; Fri, 03 Apr 2020 19:21:52 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=stephe-leake.org; s=default; h=Content-Type:MIME-Version:Message-ID: In-Reply-To:Date:References:Subject:To:From:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=9buE9I5N64s7/EGO2q6gksxBsQ4F6XSPCK7sJtlEWdo=; b=jakbF/mta4VswBVC+0b5i8IR8 +tPEDUJKk5H6Ecf4lFPiz2Kg8Gz3B7BZg40GfSEWfHQpJwaWLyFJDK9kj3I3Ivqk8GED4zC/wDPng S1Ho8V2huQ2eXYZhZIbFL/kKwG3/rb2UNrDEcfsjrIhuaeRzMgWPdySXsNLBTd3NXlZ/FRQvJdz3r wR8YjAHTHjYpCrdZwO5WYmt/UNH8cye0Sv4ZsdbyN1ipfwcfux1xP6F7RabPcx+wRSE5YGGjY4Xgt WqZemeK0Yst0VzjAr+6a2luhaE5XrnPaPGmET0w0sayHY1kO2RNOTRMJ2uaE3treROh0RaFHy1VWU a/REPQqxA==; Original-Received: from [76.77.182.20] (port=64610 helo=Takver4) by host2007.hostmonster.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1jKWZL-000Yar-LT for emacs-devel@gnu.org; Fri, 03 Apr 2020 18:21:51 -0600 In-Reply-To: (Serghei's message of "Fri, 03 Apr 2020 22:20:31 +0000") X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host2007.hostmonster.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - stephe-leake.org X-BWhitelist: no X-Source-IP: 76.77.182.20 X-Source-L: No X-Exim-ID: 1jKWZL-000Yar-LT X-Source-Sender: (Takver4) [76.77.182.20]:64610 X-Source-Auth: stephen_leake@stephe-leake.org X-Email-Count: 4 X-Source-Cap: c3RlcGhlbGU7c3RlcGhlbGU7aG9zdDIwMDcuaG9zdG1vbnN0ZXIuY29t X-Local-Domain: yes X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 192.185.149.62 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:246368 Archived-At: Serghei writes: > Hello Stephen, > >> > I am creating a new mode called zephir-mode [1]. The main goals of >> > this mode is to provide syntax highlighting, indentation, movement, >> > navigation support and Imenu for Zephir 2 language. >> >> The ELPA package wisi can help here (I'm the author). > > In this case users will have to run an external process, right? They will have to run ~/.emacs.d/elpa/ada-mode-i.jj/build.sh and install.sh manually when the package is installed; that requires an Ada compiler, and manual installation a compiler vendor library (the Debian packages are _not_ adequate, as of last month). That's fine for people who are already using Ada; it is a pretty high bar for others. (now that I've actually said that in an email, I realize I might be able to improve it some). Actually running the process is transparent. > This is a little worrying for me. I would prefer to use the built-in > functionality for as long as possible. Partly due to the fact that > users are reluctant (and not always successful) installs new software. At one time, wisi supported an elisp-only option. But I did not want to implement error correction in the elisp parser; it was hard enough in Ada. So the elisp was dropped. The built-in package semantic provides a parser generator and run-time in elisp. That parser does not do error correction, so the results are less than satisfactory. >> > I'd like to provide the patterns I'm trying to catch: >> > protected foo; >> > protected static foo; >> > public bar = 1; >> > private baz = []; >> > private baz = [] { set }; >> > protectd foo { get }; >> > public static bar = 42; >> > private static baz = 13 { get }; >> > private baz = 13 { get, set, toString }; >> >> This definitely would be easier with a parser. > > > Of course, any LR(k) parser can handle this. But what about SMIE? > Won't it be more organic? I tried SMIE for Ada; it proved inadequate, since in Ada you always have to parse the whole file. For just the code you show here, SMIE should be ok. And since it focusses on local parsing, it should be pretty error-tolerant. eglot (https://github.com/joaotavora/eglot) is an option, if there is an existing LSP server for your language (or for a similar-enough language). At some point, I'd like to allow wisi to use an LSP server as the parser. -- -- Stephe