bug-global
[Top][All Lists]
Advanced

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

Zig parsers for Global


From: Simon D
Subject: Zig parsers for Global
Date: Fri, 1 Sep 2023 16:39:32 -0700


Hi Shigio and other Global developers,

I have created Zig parsers for Gtags and Htags version 6.6.10.

I don't program in Zig, but have tested it on a number of Zig source files.
Zig is an Open Source language, so you can download its source files.

I did modify makeincludeindex() to include the @import() functions of Zig, but
it didn't seem to make any difference, so I removed the code.
The @import functions (like '#include' in C) are made into HTML links with the
htags parser, and they work.

Had to change compress() for names beginning with '@' in them.
I don't think you need to change the version number of the format of the
Global databases. I have left the '@' character in as part of the name, like in
the built-in function '@ptrToInt' for example, as this is what the text editor
Kate also does when syntax hilighting Zig code. Thus it gets saved into the
databases as '@ptrToInt'.
But the HTML index htags generates, doesn't include an entry for names
beginning with '@' yet, maybe one day.

Also changed HTML_quoting() in 'htags/src2html.c' to help spot and make safe
funny characters in source files, like the ones in
'libdb/sqlite3.c' (0xB1 and 0xC4); but this change is not really necessary.

I thought I had gone wrong with the Zig function pointers, like 'xxx: fn ()',
that are in 'struct' statements, as some of them don't get the guide/icons with
them, but these function pointers are not function definitions.
I will fix this in the next update of the Zig parsers.

I think I can add code to parse Zig function calls, so this could be a future
enhancement.

I have also fixed some minor text messages, code and doxygen code, hope they
are ok.

Hope these parsers are useful for Global.

(Feature request: a Language Server Protocol [LSP] interface).

I will be sending another email soon, more bugs, mainly involving strcmp().
And one bug found in __bt_first() 'libdb/bt_seq.c' by CppCheck:

'if ((h = xxx()) == NULL) { if (h->pgno == save.page->pgno) ....}'



Simon Dommett

Attachment: zig_parsers_for_global.patch
Description: Text Data


reply via email to

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