|
From: | João Paulo Labegalini de Carvalho |
Subject: | Re: Call for volunteers: add tree-sitter support to major modes |
Date: | Mon, 24 Oct 2022 09:44:43 -0600 |
João Paulo Labegalini de Carvalho <jaopaulolc@gmail.com> writes:
> 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?
Can you post the whole mode in its current state? Then I can help you
debug it. I've seen errors like this myself, but most of the time it
has been some sort of error, like a typo in one of the strings.
I feel there's too little to know exactly what is wrong from your mail,
so the whole source would be nice!
Thanks,
Theo
[Prev in Thread] | Current Thread | [Next in Thread] |