all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#64567: 29.0.92; c-ts-mode fails to parse syslogger.c of postgres source
       [not found] <87r0pf1eal.fsf@qq.com>
@ 2023-07-11  0:30 ` Yang Yingchao via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-07-11 11:58   ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Yang Yingchao via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-07-11  0:30 UTC (permalink / raw)
  To: 64567

[-- Attachment #1: Type: text/plain, Size: 4005 bytes --]

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()`.



In GNU Emacs 29.0.92 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.38, cairo version 1.17.8) of 2023-07-11 built on tbook
Repository revision: 419b4d44914701cedf308df58c3e5789715c87e7
Repository branch: HEAD
System Description: Gentoo Linux

Configured using:
 'configure 'CFLAGS=-O2 -march=native -pipe -g' LDFLAGS= --with-xml2
 --with-json --with-modules --without-pop --without-imagemagick
 --with-native-compilation --with-pgtk --with-xft --with-harfbuzz
 --with-tree-sitter --without-x --without-ns'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LCMS2 LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK
PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS
TREE_SITTER WEBP XIM GTK3 ZLIB

Important settings:
  value of $LANG: zh_CN.UTF8
  value of $XMODIFIERS: @im=fcitx
  locale-coding-system: utf-8-unix

Major mode: C/*

Minor modes in effect:
  treesit-explore-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort emacsbug mail-extr message sendmail mailcap yank-media puny
dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg
rfc6068 epg-config gnus-util text-property-search time-date mm-decode
mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util
ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader
c-ts-mode c-ts-common treesit vc-git diff-mode easy-mmode vc-dispatcher
cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine
cc-vars cc-defs comp comp-cstr warnings icons subr-x rx cl-seq cl-macs
gv cl-extra help-mode cl-loaddefs cl-lib bytecomp byte-compile
china-util rmc iso-transl tooltip cconv eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win
pgtk-win term/common-win pgtk-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode
register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads dbusbind inotify dynamic-setting system-font-setting
font-render-setting cairo gtk pgtk lcms2 multi-tty make-network-process
native-compile emacs)

Memory information:
((conses 16 456295 34678)
 (symbols 48 9761 0)
 (strings 32 44677 2133)
 (string-bytes 1 1728443)
 (vectors 16 41351)
 (vector-slots 8 598570 44421)
 (floats 8 58 41)
 (intervals 56 38142 182)
 (buffers 984 14))

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#64567: 29.0.92; c-ts-mode fails to parse syslogger.c of postgres source
  2023-07-11  0:30 ` bug#64567: 29.0.92; c-ts-mode fails to parse syslogger.c of postgres source Yang Yingchao via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-07-11 11:58   ` Eli Zaretskii
  2023-07-12  1:05     ` Yang Yingchao via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2023-07-11 11:58 UTC (permalink / raw)
  To: yang.yingchao, Yuan Fu, Theodor Thornhill; +Cc: 64567

> 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.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#64567: 29.0.92; c-ts-mode fails to parse syslogger.c of postgres source
  2023-07-11 11:58   ` Eli Zaretskii
@ 2023-07-12  1:05     ` Yang Yingchao via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 3+ messages in thread
From: Yang Yingchao via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-07-12  1:05 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 64567, Yuan Fu, Theodor Thornhill

[-- Attachment #1: Type: text/plain, Size: 1380 bytes --]

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*

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-07-12  1:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <87r0pf1eal.fsf@qq.com>
2023-07-11  0:30 ` bug#64567: 29.0.92; c-ts-mode fails to parse syslogger.c of postgres source Yang Yingchao via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-11 11:58   ` Eli Zaretskii
2023-07-12  1:05     ` Yang Yingchao via Bug reports for GNU Emacs, the Swiss army knife of text editors

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.