emacs-devel
[Top][All Lists]
Advanced

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

Re: Call for volunteers: add tree-sitter support to major modes


From: João Paulo Labegalini de Carvalho
Subject: Re: Call for volunteers: add tree-sitter support to major modes
Date: Sat, 22 Oct 2022 09:51:58 -0600

I am getting a query error but I don't understand why.

The following query is fine:

(defvar sh-script--treesit-bash-keywords
  '("case" "do" "done" "elif" "else" "esac" "export" "fi" "for"
    "function" "if" "in" "unset" "while" "then"))

(treesit-validate-query 'bash `([ ,@sh-script--treesit-bash-keywords ] @font-lock-keyword-face))

However the following query is said INVALID by `treesit-validate-query':
(treesit-validate-query 'bash `([ ,@(sh-feature sh-leading-keywords) ] @font-lock-keyword-face))
Node type error at: 3
["time" "!" "do" "done" ...] @font-lock-keyword-face

time" is highlighted in the *tree-sitter check query* buffer. 

Even though the forms below evaluate to equivalent forms:
`([ ,@sh-script--treesit-bash-keywords] @font-lock-keyword-face)
evaluates to:
([ "case" "do" "done" "elif" ... ] @font-lock-keyword-face)

`([ ,@(sh-feature sh-leading-keywords) ] @font-lock-keyword-face)
evaluates to:
(["time" "!" "do" "done" ...] @font-lock-keyword-face)


Any clues to what I am doing wrong?

On Sat, Oct 22, 2022 at 12:42 AM Eli Zaretskii <eliz@gnu.org> wrote:
> From: João Paulo Labegalini de Carvalho <jaopaulolc@gmail.com>
> Date: Fri, 21 Oct 2022 17:45:41 -0600
> Cc: emacs-devel@gnu.org
>
> With the work a did today I was able to answer my own questions.
>
> I managed to use `sh-feature' function to obtain the lists of keywords & builtins for fontification.
>
> I am planning to soon submit a patch for review but mainly for the style of bits I have implemented.

Thanks for working on this.


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