[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Tree-sitter integration in python.el
From: |
Matthias Meulien |
Subject: |
Re: Tree-sitter integration in python.el |
Date: |
Tue, 04 Oct 2022 00:19:43 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
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

I'll keep using this branch and collect unexpected behaviors.
--
Matthias
- Re: Tree-sitter integration in python.el, Matthias Meulien, 2022/10/03
- Re: Tree-sitter integration in python.el, Eli Zaretskii, 2022/10/03
- Re: Tree-sitter integration in python.el,
Matthias Meulien <=
- Re: Tree-sitter integration in python.el, Yuan Fu, 2022/10/03
- Re: Tree-sitter integration in python.el, Matthias Meulien, 2022/10/03
- Re: Tree-sitter integration in python.el, Yuan Fu, 2022/10/05
- Re: Tree-sitter integration in python.el, Matthias Meulien, 2022/10/06
- Re: Tree-sitter integration in python.el, Yuan Fu, 2022/10/06
- Re: Tree-sitter integration in python.el, Matthias Meulien, 2022/10/06
- Re: Tree-sitter integration in python.el, Yuan Fu, 2022/10/07
- Re: Tree-sitter integration in python.el, Augusto Stoffel, 2022/10/07
- Re: Tree-sitter integration in python.el, chad, 2022/10/07
- Re: Tree-sitter integration in python.el, Eli Zaretskii, 2022/10/07