unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Matthias Meulien <orontee@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: casouri@gmail.com,  emacs-devel@gnu.org
Subject: Re: Tree-sitter integration in python.el
Date: Tue, 04 Oct 2022 00:19:43 +0200	[thread overview]
Message-ID: <87tu4klfcw.fsf@gmail.com> (raw)
In-Reply-To: <83czb8ycpo.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 03 Oct 2022 21:38:27 +0300")

[-- Attachment #1: Type: text/plain, Size: 1542 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Matthias Meulien <orontee@gmail.com>
>> Cc: emacs-devel <emacs-devel@gnu.org>
>> Date: Mon, 03 Oct 2022 20:07:44 +0200
>> 
>> I also cloned tree-sitter-python but I've no idea of what should be done
>> with the grammar file.  I've understood that I am suppposed to convert
>> the grammar to a shared object but I don't know how...
>> 
>> (I've tree-sitter-cli installed and in path, but "tree-sitter generate
>> tree-sitter-python/grammar.js" seems to generate rust and node bindings;
>> Am I supposed to compile the src/parser.c file?  I don't see any
>> Makefile...).
>
> Some of these lack the Makefile.  But the Makefile is standard and can
> be taken from any other language module, for example I see on in
> tree-sitter-ruby.  So just clone that as well, copy its Makefile into
> tree-sitter-python, and run "make".

Thank you, Eli.  It wasn't as easy as you said but I managed to compile
a shared object using a modified version of the Makefile found in the
tree-sitter-ruby (using the file as is fails when building
tree-sitter-{ruby,python} due to a missing -Wl, before -soname usage).

At first sight, moving commands and imenu seems to work as
expected.  Fontification too.

I saw small differences between buffers fontified with
`python-use-tree-sitter' equal to nil and t.  Attached is a screenshot
where one can see two such differences (the third tall buffer shows the
output of "tree-sitter highlight"):

- line 284: The self attribute

- line 296: The variable in the f-string


[-- Attachment #2: Capture d’écran de 2022-10-04 00-07-27.png --]
[-- Type: image/png, Size: 599187 bytes --]

[-- Attachment #3: Type: text/plain, Size: 76 bytes --]


I'll keep using this branch and collect unexpected behaviors.
-- 
Matthias

  reply	other threads:[~2022-10-03 22:19 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-22 18:42 Tree-sitter integration in python.el Yuan Fu
2022-09-26 19:10 ` Jostein Kjønigsen
2022-09-27 22:16   ` Yuan Fu
2022-10-03 18:07 ` Matthias Meulien
2022-10-03 18:38   ` Eli Zaretskii
2022-10-03 22:19     ` Matthias Meulien [this message]
2022-10-03 22:31       ` Yuan Fu
2022-10-03 22:47         ` Matthias Meulien
2022-10-06  2:56           ` Yuan Fu
2022-10-06  7:18             ` Matthias Meulien
2022-10-06 18:26               ` Yuan Fu
2022-10-06 20:53                 ` Matthias Meulien
2022-10-07  8:25                   ` Yuan Fu
2022-10-07 10:03                     ` Augusto Stoffel
2022-10-07 17:53                       ` chad
2022-10-07 19:09                         ` Eli Zaretskii
2022-10-07 22:17                         ` Yuan Fu
2022-10-07 22:10                       ` Yuan Fu
2022-10-08  6:30                         ` Eli Zaretskii
2022-10-08 20:57                           ` Yuan Fu
2022-10-09  4:13                             ` Eli Zaretskii
2022-10-11 22:15                             ` Stefan Monnier
2022-10-12  5:04                               ` Yuan Fu
2022-10-12 17:52                                 ` Stefan Monnier
2022-10-12 22:55                                   ` Yuan Fu
2022-10-12 23:43                                     ` Yuan Fu
2022-10-13  0:16                                       ` [SPAM UNSURE] " Stephen Leake
2022-10-13  5:55                                       ` Eli Zaretskii
2022-10-15 23:15                                         ` Yuan Fu
2022-10-08  8:03                         ` Augusto Stoffel
2022-10-08 16:20                           ` [External] : " Drew Adams
2022-10-10 15:38                             ` Augusto Stoffel
2022-10-08 21:06                           ` Yuan Fu
2022-10-10  7:16                             ` Augusto Stoffel
2022-10-10 15:10                               ` Yuan Fu
2022-10-10 15:53                                 ` Augusto Stoffel
2022-10-12  5:08                                   ` Yuan Fu
2022-10-11 22:18                                 ` Stefan Monnier
2022-10-04  6:13       ` Eli Zaretskii
2022-10-04 11:21         ` Matthias Meulien
2022-10-04 12:33           ` Eli Zaretskii
2022-10-04 17:11             ` Matthias Meulien
2022-10-03 22:25   ` Yuan Fu
2022-10-16  7:31     ` Eli Zaretskii
2022-10-16  8:15       ` Yuan Fu
2022-10-16  8:18         ` Eli Zaretskii
2022-10-03 22:35 ` Matthias Meulien
  -- strict thread matches above, loose matches on Subject: below --
2022-10-03 21:53 lkg.ch@pm.me

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=87tu4klfcw.fsf@gmail.com \
    --to=orontee@gmail.com \
    --cc=casouri@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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).