GNU bug report logs - #64567
29.0.92; c-ts-mode fails to parse syslogger.c of postgres source

Previous Next

Package: emacs;

Reported by: yang.yingchao <at> qq.com

Date: Tue, 11 Jul 2023 00:48:02 UTC

Severity: normal

Merged with 64568

Found in version 29.0.92

Full log


View this message in rfc822 format

From: Yang Yingchao <yang.yingchao <at> qq.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 64567 <at> debbugs.gnu.org, Yuan Fu <casouri <at> gmail.com>, Theodor Thornhill <theo <at> thornhill.no>
Subject: bug#64567: 29.0.92; c-ts-mode fails to parse syslogger.c of postgres source
Date: Wed, 12 Jul 2023 09:05:37 +0800
[Message part 1 (text/plain, inline)]
Sure, thanks.

On Tue, Jul 11 2023, Eli Zaretskii <eliz <at> gnu.org> wrote:

>> Date: Tue, 11 Jul 2023 08:30:51 +0800
>> From:  Yang Yingchao via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>>
>> 1. get source file from
>> <https://github.com/postgres/postgres/blob/master/src/backend/postmaster/syslogger.c>
>> 1. open it, and move to line 567, then we can see function
>> `SysLogger_Start(void)` is not highlighted properly.
>>
>> `treesit-explore-mode` shows some error too:
>>
>> ```
>> (ERROR type: (primitive_type)
>>  (function_declarator declarator: (identifier)
>>   parameters:
>>    (parameter_list (
>>     (parameter_declaration type: (primitive_type))
>>     )))
>>
>> ```
>>
>> And when cusor is inside this function, and `treesit-beginning-of-defun`
>> will move cusor to `SysLoggerMain()` which is actully the function
>> before `SysLogger_Start()`.
>
> It's because of this:
>
>
>   #ifdef EXEC_BACKEND
> 	  switch ((sysloggerPid = syslogger_forkexec()))
>   #else
> 	  switch ((sysloggerPid = fork_process()))
>   #endif
>
> The 2 'switch' statements inside preprocessor conditions cause the
> parser to fail.  I'm not sure we can do anything with this, except
> report this to the developers of the tree-sitter C grammar, but I CC
> Yuan and Theo just in case they have some ideas.



Regards,

-- *Yang Yingchao*

This bug report was last modified 2 years and 39 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.