emacs-devel
[Top][All Lists]
Advanced

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

Re: Tree sitter support for C-like languages


From: Yuan Fu
Subject: Re: Tree sitter support for C-like languages
Date: Wed, 16 Nov 2022 09:29:42 -0800


> On Nov 16, 2022, at 5:29 AM, Po Lu <luangruo@yahoo.com> wrote:
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
>> DEFUN is Emacs-specific, but the other examples I've shown aren't, I
>> see them in many other programs.
> 
> Right.  What about "common" macros, such as ones that involve type
> names?
> 
> For example, here is some sample GLib code, and GLib is a library used
> widely throughout GNOME and freedesktop.org:
> 
> #ifdef HAVE_GTK3
> static void emacs_menu_bar_get_preferred_width (GtkWidget *, gint *, gint *);
> static GType emacs_menu_bar_get_type (void);
> 
> typedef struct _EmacsMenuBar
> {
>  GtkMenuBar parent;
> } EmacsMenuBar;
> 
> typedef struct _EmacsMenuBarClass
> {
>  GtkMenuBarClass parent;
> } EmacsMenuBarClass;
> 
> G_DEFINE_TYPE (EmacsMenuBar, emacs_menu_bar, GTK_TYPE_MENU_BAR)
> #endif
> 
> Note how the the macro has no trailing semicolon.  That is required for
> it to work correctly (I don't know why.)

They are fine, missing a semicolon is no big deal. On the other hand DEFUN is 
far enough from normal C syntax.

Yuan




reply via email to

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