emacs-devel
[Top][All Lists]
Advanced

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

Re: Tree-sitter api


From: Yuan Fu
Subject: Re: Tree-sitter api
Date: Sat, 11 Sep 2021 13:29:09 -0700

> On Sep 11, 2021, at 12:14 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
> But the <lang> part is still needed to be concocted somehow.  E.g.,
> the conversion from "C#" to "c-sharp" isn't trivial.
> 

The project name of tree-sitter’s C# definition is “tree-sitter-c-sharp”[1]. So 
if someone wants to use the C# language, they probably know what symbol 
represents it (we will explain the translation rule in doc-string and the 
manual). I also want to point out that we don’t come up with the symbols 
representing each language, the _user_ passes 'tree-sitter-parser-create' a 
symbol representing a language, and we translate that symbol to dynamic library 
name and C symbol name.

[1]: https://github.com/tree-sitter/tree-sitter-c-sharp


> On Sep 11, 2021, at 12:17 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
>> Date: Sat, 11 Sep 2021 22:14:26 +0300
>> From: Eli Zaretskii <eliz@gnu.org>
>> Cc: ubolonton@gmail.com, theo@thornhill.no, cpitclaudel@gmail.com,
>> emacs-devel@gnu.org, monnier@iro.umontreal.ca, stephen_leake@stephe-leake.org
>> 
>>> BTW, since dynamic libraries has different extensions on different systems, 
>>> what I want to do it to try loading the library with .so, then try .dylib, 
>>> then try .dll, is that a good idea?
>> 
>> We can do better, see load-suffixes.
> 
> And in C, you can use MODULES_SUFFIX directly.  Though we will
> probably need some minor changes there, to have the suffix defined
> even in a build --without-modules.

I’m using tree-sitter-load-suffixes with default value ‘(“.so”, “.dylib”, 
“.dll”). Should I populate this variable with MODULES_SUFFIX and 
MODULES_SECONDARY_SUFFIX, or should I just use the two SUFFIX in C? I.e., do 
you see a need for users to customize suffixes?

Yuan


reply via email to

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