A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://lists.gnu.org/archive/html/emacs-devel/2022-11/msg00964.html below:

Re: Tree sitter support for C-like languages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] From: Yuan Fu Subject: Re: Tree sitter support for C-like languages Date: Tue, 15 Nov 2022 10:36:09 -0800
> On Nov 15, 2022, at 10:27 AM, Visuwesh <visuweshm@gmail.com> wrote:
> 
> [செவ்வாய் நவம்பர் 15, 2022] Eli Zaretskii wrote:
> 
>>> From: Stefan Monnier <monnier@iro.umontreal.ca>
>>> Cc: Yuan Fu <casouri@gmail.com>,  theo@thornhill.no,  emacs-devel@gnu.org
>>> Date: Tue, 15 Nov 2022 11:01:24 -0500
>>> 
>>>> I guess we need to report these to the developers of the Tree-sitter's
>>>> C parser?  Is there anything else we could do until they fix
>>>> the parser?
>>> 
>>> AFAIK the tree-sitter parser parses basically already-preprocessed C.
>>> It's wickedly hard to parse meaningfully notyet-preprocessed C with
>>> something based on a BNF grammar.
>> 
>> There are a lot of macros in our code that tree-sitter based C mode
>> gets right, so I'm not sure this is accurate.
>> 
>>> So my guess is that this is going to be a "wont fix".
>> 
>> Maybe we should grow some augmentations for tree-sitter, at least
>> given enough time.  Or maybe it's possible to identify the parts where
>> this happens by some tree-sitter indications, and tweak the faces in
>> those regions in some way.
> 
> I'm not sure how similar the emacs-tree-sitter
> (https://github.com/ubolonton/emacs-tree-sitter) and Yuan's code are but
> in his EmacsConf 2020 talk, Tuấn-Anh Nguyễn wrote some custom
> tree-sitter query (?) to correctly parse our macros and highlighted the
> type, the function name, etc. with the approriate faces.
> You can find his talk here: https://emacsconf.org/2020/talks/23 and his
> demonstration of the Emacs source code is around the 20 minute mark
> (after a quick search in the subtitles).

Oh nice, I’ll check that out. CCing him for some insights :-)

Yuan




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4