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

Ensure rust keywords are escaped #13

Closed
glihm opened this issue Feb 2, 2024 · 1 comment
Closed

Ensure rust keywords are escaped #13

glihm opened this issue Feb 2, 2024 · 1 comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@glihm
Copy link
Collaborator

glihm commented Feb 2, 2024

There are some keywords in rust that are allowed in cairo (like type).

The idea of this issue is to find an elegant solution to escape rust keywords when struct or enum members/variants are expanded. But here are some limitations:

  1. With proc-macro2, we can't cast the string r#type into an Ident. It's an invalid identifier.
  2. Also, when using quote!, we can't do quote!(r##name).

Currently there's a workaround only for the type keyword.

@glihm glihm added good first issue Good for newcomers help wanted Extra attention is needed labels Feb 2, 2024
@glihm
Copy link
Collaborator Author

glihm commented Feb 10, 2024

More keyword were merged in #16.

@glihm glihm closed this as completed Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant