emacs-devel
[Top][All Lists]
Advanced

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

Re: Clarification about treesit-font-lock-settings


From: Yuan Fu
Subject: Re: Clarification about treesit-font-lock-settings
Date: Sun, 26 Feb 2023 01:15:41 -0800


> On Feb 25, 2023, at 2:18 PM, Vincenzo Pupillo <v.pupillo@gmail.com> wrote:
> 
> Okay, I figured out how to do it:
>    :language 'php
>    :feature 'attribute
>    '((((attribute (_) @attribute_name) @font-lock-preprocessor-face) (:match 
> "Deprecated" @attribute_name)))
> 
> However, I cannot understand why "treesit-query-validate" says the query is 
> correct, but I get an error.
> 
> Thank you.
> Vincenzo

Sorry that I missed your message! treesit-query-validate simply compiles the 
query and rely on tree-sitter to report any potential error. But predicates 
like #match and #equal are delegated to Emacs to handle, so tree-sitter doesn’t 
check for their arity and there is no error during compilation. Also, the error 
message should say “#match” instead of “#equal”, I fixed that typo.

Yuan


reply via email to

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