Skip to content

feat(inputencoding): use C enum values #98

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Marcono1234
Copy link
Contributor

@Marcono1234 Marcono1234 commented Apr 18, 2025

The current implementation implicitly relies on the following:

  • That the C enum values in tree-sitter start at 0 and have consecutive values
  • That Java enum's ordinal() begins at 0
  • That the C and Java enum values are in the same order

Currently all of this is the case, but it feels a bit brittle.

Because the C enum constant values are part of the jextract generated code, it seems more reliable to use them instead.

Is more robust than implicitly relying on Java and C enum having same values.
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