Skip to content
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

Coding style: Use enum helpers for Attribute::Kind #1936

Open
rsmmr opened this issue Dec 4, 2024 · 1 comment · May be fixed by #1941
Open

Coding style: Use enum helpers for Attribute::Kind #1936

rsmmr opened this issue Dec 4, 2024 · 1 comment · May be fixed by #1941
Assignees

Comments

@rsmmr
Copy link
Member

rsmmr commented Dec 4, 2024

Attribute::Kind is currently a member of Attribute, with custom tagToKind() and kindToString() methods. For consistency with other enums, we should move Kind to outside the class (namespaced to hilt::attribute::Kind), use the util::enum_:* helpers, and provide overloads for to_string() and from_string().

As an existing example, see the corresponding code for function::CallingConvention in hilti/ast/function.h.

@bbannier bbannier assigned bbannier and unassigned bbannier Dec 4, 2024
@bbannier bbannier self-assigned this Dec 5, 2024
@rsmmr
Copy link
Member Author

rsmmr commented Dec 11, 2024

I realized we have another issue with the new Kind enum: Spicy-side values now reside inside HILTI headers, which isn't great (things like MaxSize and ParseAt is nothing that HILTI should know about). Not immediately sure how to fix that, it's really like we'd need two enum types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants