emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Implementation direction for shell-script-mode with tree-sitter


From: João Paulo Labegalini de Carvalho
Subject: Re: Implementation direction for shell-script-mode with tree-sitter
Date: Tue, 25 Oct 2022 10:26:32 -0600

AFAIK `time` is clearly a bug in the tree-sitter grammar.
E.g. it probably causes a misparse for things like:

    time while ... do ... done

That was my impression as well.

The same probably holds for `coproc`.
I suspect that for the other ones it doesn't make much difference, OTOH.
So maybe the other ones were deliberately omitted to keep
the grammar simpler.

So maybe I should just use a more generic query and use a regex to fontify the keywords. Something like this:

(command_name ((word) @font-lock-keyword-face
               (:match <rx string regex here> @font-lock-keyword-face)))

--
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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]