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

parse some more syntax #8

Merged
merged 5 commits into from
Oct 19, 2024
Merged

parse some more syntax #8

merged 5 commits into from
Oct 19, 2024

Conversation

jyn514
Copy link
Contributor

@jyn514 jyn514 commented Oct 19, 2024

@jyn514 jyn514 merged commit d42dbb2 into main Oct 19, 2024
2 checks passed
@oli-obk oli-obk deleted the syntax branch October 19, 2024 08:33
// SAFETY: we just checked this is a valid variant.
unsafe { std::mem::transmute::<u16, SyntaxKind>(raw.0) }
unsafe { std::mem::transmute::<u32, SyntaxKind>(raw.0) }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, if you're not opposed to proc-macros, cstree has a derive feature with a derive macro for Syntax that automates this conversion, including the unsafe stuff.

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.

2 participants