all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Po Lu <luangruo@yahoo.com>
To: "João Paulo Labegalini de Carvalho" <jaopaulolc@gmail.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: Wed, 26 Oct 2022 08:52:27 +0800	[thread overview]
Message-ID: <87mt9j1k50.fsf@yahoo.com> (raw)
In-Reply-To: <CAGjvy2_a_BUUD_zBC_4_s3UN6DFbhoru_E5P2u2TX-fQ+Juewg@mail.gmail.com> ("João Paulo Labegalini de Carvalho"'s message of "Tue, 25 Oct 2022 09:05:10 -0600")

João Paulo Labegalini de Carvalho <jaopaulolc@gmail.com> writes:

> Hi,
>
> The tree-sitter-bash grammar does not include many reserved words and
> builtin commands that are currently fontified by the regex based
> fontication in shell-script-mode.
>
> Here a list of the ones that tree-sitter-bash does not recognize:
>
> ("time" "coproc" "type" "trap" "exit" "exec" "continue" "break" "return" "logout" "bye")
>
> According to the Bash Reference Manual, all of the above are reserved words.
>
> Should I make a PR to tree-sitter-bash to incorporate the missing
> keywords or should I just filter them out of the list that I obtain
> through (and other variables in `shell-script-mode'):
>
> (append (sh-feature sh-leading-keywords)
>         (sh-feature sh-other-keywords))
>
> I am attaching the patch so everyone can see code and understand
> better what I did. I welcome all criticism and feedback.
>
> PS.: I am looking at the tree-sitter-bash and it does not seem very
> complicated to extend it to recognize the missing keywords. But I can
> definitely keep working independently of that.

N.B that shell-script-mode supports shells other than bash, so maybe a
tree-sitter-bash based variant should be spun off into its own
`bash-mode', as opposed to possibly interfering with the support for all
of rest?



  parent reply	other threads:[~2022-10-26  0:52 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 [this message]
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

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=87mt9j1k50.fsf@yahoo.com \
    --to=luangruo@yahoo.com \
    --cc=casouri@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=jaopaulolc@gmail.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.