bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#64567: 29.0.92; c-ts-mode fails to parse syslogger.c of postgres sou


From: Yang Yingchao
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
User-agent: mu4e 1.10.4; emacs 29.0.92

Sure, thanks.

On Tue, Jul 11 2023, Eli Zaretskii <eliz@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@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*

reply via email to

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