From: "João Paulo Labegalini de Carvalho" <jaopaulolc@gmail.com>
To: Po Lu <luangruo@yahoo.com>
Cc: emacs-devel@gnu.org, Yuan Fu <casouri@gmail.com>,
Theodor Thornhill <theo@thornhill.no>,
Eli Zaretskii <eliz@gnu.org>
Subject: Re: Implementation direction for shell-script-mode with tree-sitter
Date: Thu, 27 Oct 2022 08:22:00 -0600 [thread overview]
Message-ID: <CAGjvy2-Ne1m_uoa0Ovb17ScKhGpqEDUrEP5pHNmgDkbKVoBtKg@mail.gmail.com> (raw)
In-Reply-To: <87tu3q6q8m.fsf@yahoo.com>
[-- Attachment #1: Type: text/plain, Size: 1233 bytes --]
>
> Some shells, such as csh, are very syntactically different from
> bash.
>
That should not be a problem for tree-sitter as, once the csh tree-sitter
library is loaded, the queries will only match the particular keywords and
built-in commands of csh.
However, I am able to test other shell variants as there is no tree-sitter
grammar for them. The only one I have access to is for bash, but as I said
I am trying to keep the implementation as generic as possible so, once
those grammars are available the effort to use them should be low.
> So won't you end up, in effect, reproducing the existing font-lock code?
>
That seems to be the case for the keyword fontification generated from the
`sh-font-lock-var*' variables. The only way I found to avoid this is to
explicitly specify the same regex queries for fontification used currently
in sh-mode in the tree-sitter queries. This will create duplication of data
but avoids the undesirable duplication of font-lock code.
--
João Paulo L. de Carvalho
Ph.D Computer Science | IC-UNICAMP | Campinas , SP - Brazil
Postdoctoral Research Fellow | University of Alberta | Edmonton, AB - Canada
joao.carvalho@ic.unicamp.br
joao.carvalho@ualberta.ca
[-- Attachment #2: Type: text/html, Size: 1922 bytes --]
prev parent reply other threads:[~2022-10-27 14:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-25 15:05 Implementation direction for shell-script-mode with tree-sitter João Paulo Labegalini de Carvalho
2022-10-25 15:46 ` Stefan Monnier
2022-10-25 16:26 ` João Paulo Labegalini de Carvalho
2022-10-26 0:52 ` Po Lu
2022-10-26 15:48 ` João Paulo Labegalini de Carvalho
2022-10-27 0:54 ` Po Lu
2022-10-27 6:06 ` Eli Zaretskii
2022-10-27 14:23 ` João Paulo Labegalini de Carvalho
2022-10-27 15:53 ` Eli Zaretskii
2022-10-27 14:22 ` João Paulo Labegalini de Carvalho [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAGjvy2-Ne1m_uoa0Ovb17ScKhGpqEDUrEP5pHNmgDkbKVoBtKg@mail.gmail.com \
--to=jaopaulolc@gmail.com \
--cc=casouri@gmail.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=luangruo@yahoo.com \
--cc=theo@thornhill.no \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.