emacs-devel
[Top][All Lists]
Advanced

[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 19:11:34 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Matthias Meulien <orontee@gmail.com>
>> Cc: casouri@gmail.com,  emacs-devel@gnu.org
>> Date: Tue, 04 Oct 2022 13:21:45 +0200
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> > (...)  Would you please share the changes you made, FTR?  Then others
>> > who face the same problem could easily find the solution.  TIA.
>> 
>> Sure, but let me make clear that it's an unclean hack and using
>> https://github.com/casouri/tree-sitter-module may prove to be more
>> robust.
>
> Understood, thanks.
>
>> diff --unified tree-sitter-ruby/Makefile tree-sitter-python/Makefile
>> --- tree-sitter-ruby/Makefile        2022-10-03 23:01:34.963750322 +0200
>> +++ tree-sitter-python/Makefile      2022-10-04 13:06:46.014817832 +0200
>> @@ -31,7 +31,7 @@
>>  ifeq (, $(CPPSRC))
>>      ADDITIONALLIBS := 
>>  else
>> -    ADDITIONALLIBS := -lc++
>> +    ADDITIONALLIBS :=
>>  endif
>
> Any reason why you needed to use the C++ compiler?

Well, I saw the C++ file tree-sitter-python/src/parser.cc
(cf. 
https://github.com/tree-sitter/tree-sitter-python/blob/master/src/scanner.cc#L1)
and also got a linker error when using the original Makefile where gcc
use option -lc++.  I didn't try to understand that error, I am used to
compile C++ using g++ so I just changed the Makefile to fix an error
I've not truly understood.

Note that
https://github.com/casouri/tree-sitter-module/blob/master/build.sh#L46
switch to using c++ compiler when a parser.cc file is found.
-- 
Matthias



reply via email to

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