C2x and C++23 add these new preprocessor conditionals, as shorter forms of #elif defined and #elif !defined.
Fixes #13667
https://github.com/vim/vim/pull/13679
(1 file)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
This is the minimal change to make vim recognize them, so that syntax highlighting works, and you can jump between them using %. I have no idea if I should have also changed cCppOutIf2, cCppInElse, etc. because I don't know what they're used for.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Another way to define that regex would be:
start="^\s*\zs\%(%:\|#\)\s*\%(\(el\)\?\(if\|ifdef\|ifndef\)\)\>"
Since each of if, ifdef, and ifndef now has an "elif" form, we can just give them all an optional el prefix.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
We were waiting for C23 to be released before including those changes. As these directives are already supported by GCC I think they should be conditionally included if the "c_gnu" flag is set.
cCpp{In,Out}* syntax groups are used to highlight 'disabled' code as comments. So these changes should, ideally, be applied there as well. See :help c_no_if0
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
I don't think waiting makes sense. Both C2x and C++23 have been approved and are just awaiting publication now. The content is final, and these new preprocessor tokens have 0% chance of being removed.
And it's not a GCC extension. GCC, Clang and Intel icx all support it in their latest production releases:
https://godbolt.org/z/Y4zoaE1Ed
Only MSVC doesn't yet:
https://en.cppreference.com/w/cpp/compiler_support#cpp23
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
cCpp{In,Out}*syntax groups are used to highlight 'disabled' code as comments. So these changes should, ideally, be applied there as well. See:help c_no_if0
OK, I'll try to do that too ...
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
I don't think waiting makes sense. Both C2x and C++23 have been approved and are just awaiting publication now. The content is final, and these new preprocessor tokens have 0% chance of being removed.
OK, if it's locked down I guess there's no reason not to add it now. There's a few other C23 related changes queued as PRs and similar that I'll try and round up soon.
I gather you noticed there's a series of version flags and we'll need a new one, c_no_c23?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
please ping me, once this is ready.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Closed #13679.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
this seems to have stalled, so let me close it for now. Please create a new PR once you have a new version ready.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
I didn't figure out how to make the requested changes, sorry.
N.B. both C23 and C++23 have now been published and the previous standards withdrawn. So #elifdef and #elifndef are in the current ISO standards.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
I think it's fixed in #12984. I'll finish that in the next couple of days.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()