unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Yuan Fu <casouri@gmail.com>
To: Vincenzo Pupillo <v.pupillo@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Clarification about treesit-font-lock-settings
Date: Sun, 26 Feb 2023 01:15:41 -0800	[thread overview]
Message-ID: <F71B953E-7FAC-4BAB-BA43-9FCF9EF47D65@gmail.com> (raw)
In-Reply-To: <CA+pSb5tg2ZUf79Ek=4B7T0f+rpcVxTzD8SqwaKYt6V9tAZcEyg@mail.gmail.com>



> 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	other threads:[~2023-02-26  9:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-25 15:33 Clarification about treesit-font-lock-settings Vincenzo Pupillo
2023-02-25 22:18 ` Vincenzo Pupillo
2023-02-26  9:15   ` Yuan Fu [this message]
2023-02-27 11:06     ` vp

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F71B953E-7FAC-4BAB-BA43-9FCF9EF47D65@gmail.com \
    --to=casouri@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=v.pupillo@gmail.com \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).