Skip to content

Allow keywords as identifiers in extern(C) blocks for better C interopability#530

Open
bangbangsheshotmedown wants to merge 4 commits intodlang-community:masterfrom
bangbangsheshotmedown:importc
Open

Allow keywords as identifiers in extern(C) blocks for better C interopability#530
bangbangsheshotmedown wants to merge 4 commits intodlang-community:masterfrom
bangbangsheshotmedown:importc

Conversation

@bangbangsheshotmedown
Copy link

@bangbangsheshotmedown bangbangsheshotmedown commented Feb 28, 2026

-Hf ouputs all symbols inside a extern(C) {} for ImportC

libdparse struggle with that if one of the symbol's identifier is a reserved keyword

This PR introduces a new config option for the Parser, bool importC, if set to true it'll relax the rule to allow keywords to be used as identifier, so it can proceed in parsing the whole extern(C) {} block properly

@bangbangsheshotmedown bangbangsheshotmedown marked this pull request as draft February 28, 2026 22:05
@bangbangsheshotmedown bangbangsheshotmedown marked this pull request as ready for review March 1, 2026 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant