Instead of cproto
, use clang.cindex
from Python to create prototype declaration files (.pro) from source code.
I'm working on Ubuntu 24.04.
$ sudo apt-get update $ sudo apt-get install -y python3 python3-pip clang libclang-dev python3-clang
https://github.com/vim/vim/pull/18045
(19 files)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
@chrisbra and Vim members,
What do you think of this approach?
Although make proto
depends on python and clang, I think it's better than continuing to use cproto
.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
@h-east pushed 11 commits.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.
@h-east pushed 8 commits.
You are receiving this because you are subscribed to this thread.
@yegappan commented on this pull request.
In src/indent.c:
> @@ -474,7 +474,7 @@ get_indent_str( return count; } -#ifdef FEAT_VARTABS +#if defined(FEAT_VARTABS) || defined(PROTO)
One suggestion: it might be easier to track the changes later, if you can separate out the changes related to the "PROTO" checks into one PR and the changes for the new script into another PR.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@h-east commented on this pull request.
In src/indent.c:
> @@ -474,7 +474,7 @@ get_indent_str( return count; } -#ifdef FEAT_VARTABS +#if defined(FEAT_VARTABS) || defined(PROTO)
Around the same time you commented, I submitted a PR implementing your suggestion 👍
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
Does this work in all platforms? And does it still require us to do all the typedef's in say os_mswin.c
(e.g. typedef int BOOL;
) or the declarations in struct.h
(e.g. typedef long varnumber_T;
).
If the answer is no, then I wonder what the point of switching to a separate Python script is?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
The answer is “Yes.” I’m still experimenting, but my goal is to get the same output in any environment where Python and Clang are available. It’s impossible to do this with a truly accurate parser, so I’m switching to an approach that detects “something like a function definition” and then generates its prototype declaration as-is.
If this works, we won’t need the PROTO
definitions themselves nor the hacky consistency-forcing code for cproto
that you mentioned.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@h-east pushed 9 commits.
You are receiving this because you are subscribed to this thread.
@h-east pushed 4 commits.
You are receiving this because you are subscribed to this thread.
@h-east pushed 2 commits.
You are receiving this because you are subscribed to this thread.